summaryrefslogtreecommitdiff
blob: 2f7de0dbe5b398545a64406bed7394ad82d1f7ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
diff -Nrup linux-2.4.26-grsec-2.0/drivers/i2c/i2c-core.c linux/drivers/i2c/i2c-core.c
--- linux-2.4.26-grsec-2.0/drivers/i2c/i2c-core.c	2004-02-18 08:36:31.000000000 -0500
+++ linux/drivers/i2c/i2c-core.c	2004-06-17 10:27:36.000000000 -0400
@@ -625,7 +625,7 @@ ssize_t i2cproc_bus_read(struct file * f
 	size_t len_total;
 	int order[I2C_CLIENT_MAX];
 
-	if (count > 4000)
+	if ((count > 4000) || (count < 0))
 		return -EINVAL; 
 	len_total = file->f_pos + count;
 	/* Too bad if this gets longer (unlikely) */