From: Roel Kluin Date: Thu, 11 Mar 2010 22:09:35 +0000 (-0800) Subject: [SCSI] gdth: fix buffer overflow X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6ce00cae684e7c6310e14634320184ca3c011750;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [SCSI] gdth: fix buffer overflow This allows i == MAXHA, which is out of range Signed-off-by: Roel Kluin Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 35a4b3073ec3..a765fe7a55c3 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -3842,7 +3842,7 @@ int __init option_setup(char *str) TRACE2(("option_setup() str %s\n", str ? str:"NULL")); - while (cur && isdigit(*cur) && i <= MAXHA) { + while (cur && isdigit(*cur) && i < MAXHA) { ints[i++] = simple_strtoul(cur, NULL, 0); if ((cur = strchr(cur, ',')) != NULL) cur++; }