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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

--- 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux