[Patch] Overrun in drivers/scsi/sim710.c

From: Eric Sesterhenn
Date: Sun Apr 09 2006 - 13:32:38 EST


hi,

this fixes coverity bug id #480.
Since id_array is declared as id_array[MAX_SLOTS],
the check for i>MAX_SLOTS is obviously false.

Signed-off-by: Eric Sesterhenn <snakebyte@xxxxxx>

--- linux-2.6.17-rc1/drivers/scsi/sim710.c.orig 2006-04-09 19:25:13.000000000 +0200
+++ linux-2.6.17-rc1/drivers/scsi/sim710.c 2006-04-09 19:27:07.000000000 +0200
@@ -75,7 +75,7 @@ param_setup(char *str)
else if(!strncmp(pos, "id:", 3)) {
if(slot == -1) {
printk(KERN_WARNING "sim710: Must specify slot for id parameter\n");
- } else if(slot > MAX_SLOTS) {
+ } else if(slot >= MAX_SLOTS) {
printk(KERN_WARNING "sim710: Illegal slot %d for id %d\n", slot, val);
} else {
id_array[slot] = val;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/