[IA64] hpsim: Fix check for overlong simscsi prefix.

When "strlen(s) > MAX_ROOT_LEN", it has already said to use the default
value, but in fact, it still use the input value.

If happens, next sprintf() for 'fname' in simscsi_queuecommand_lck()
may be memory overflow.

Signed-off-by: Chen Gang <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
This commit is contained in:
Chen Gang authored and Tony Luck committed 2013-06-03 16:09:43 -07:00
1 parent d5e660ba80
commit 69cbc0464d
1 file changed
+2 -2
+2 -2
View File
@@ -88,8 +88,8 @@ simscsi_setup (char *s)
if (strlen(s) > MAX_ROOT_LEN) {
printk(KERN_ERR "simscsi_setup: prefix too long---using default %s\n",
simscsi_root);
}
simscsi_root = s;
} else
simscsi_root = s;
return 1;
}