Skip to contentSkip to conversation

ibmmca: fix buffer overflow

PATCH In review [email protected] 1 participant 1 message Nov 17, 2009 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 3/18 ibmmca: fix buffer overflow

From: Roel Kluin <[email protected]>

Allows i == IM_MAX_HOSTS, which is out of range.

Cc Michael Lang <[email protected]>
Cc James E.J. Bottomley <[email protected]>

---

 drivers/scsi/ibmmca.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmmca.c renamed from drivers/scsi/ibmmca.c~ibmmca-buffer-overflow +1 -1
diff -puN drivers/scsi/ibmmca.c~ibmmca-buffer-overflow drivers/scsi/ibmmca.c
@@ -2336,7 +2336,7 @@ static int option_setup(char *str)
 	char *cur = str;
 	int i = 1;
 
-	while (cur && isdigit(*cur) && i <= IM_MAX_HOSTS) {
+	while (cur && isdigit(*cur) && i < IM_MAX_HOSTS) {
 		ints[i++] = simple_strtoul(cur, NULL, 0);
 		if ((cur = strchr(cur, ',')) != NULL)
 			cur++;

_