From: Roel Kluin Date: Tue, 8 Dec 2009 22:08:59 +0000 (-0800) Subject: [SCSI] u14-34f: fix buffer overflow X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4a02462af1f4c3498e6a330ffd5c063118309b31;p=linux-beck.git [SCSI] u14-34f: fix buffer overflow This allows i == MAX_INT_PARAM, which is out of range for ints[] Signed-off-by: Roel Kluin Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c index 54023d41fd15..26e8e0e6b8dd 100644 --- a/drivers/scsi/u14-34f.c +++ b/drivers/scsi/u14-34f.c @@ -1070,7 +1070,7 @@ static int option_setup(char *str) { char *cur = str; int i = 1; - while (cur && isdigit(*cur) && i <= MAX_INT_PARAM) { + while (cur && isdigit(*cur) && i < MAX_INT_PARAM) { ints[i++] = simple_strtoul(cur, NULL, 0); if ((cur = strchr(cur, ',')) != NULL) cur++;