提交 1a34456b 编写于 作者: E Eric Sesterhenn 提交者: James Bottomley

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

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: NEric Sesterhenn <snakebyte@gmx.de>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 36ab2618
...@@ -75,7 +75,7 @@ param_setup(char *str) ...@@ -75,7 +75,7 @@ param_setup(char *str)
else if(!strncmp(pos, "id:", 3)) { else if(!strncmp(pos, "id:", 3)) {
if(slot == -1) { if(slot == -1) {
printk(KERN_WARNING "sim710: Must specify slot for id parameter\n"); 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); printk(KERN_WARNING "sim710: Illegal slot %d for id %d\n", slot, val);
} else { } else {
id_array[slot] = val; id_array[slot] = val;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册