[SCSI] gdth: fix buffer overflow

This allows i == MAXHA, which is out of range

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
Roel Kluin 2010-03-11 14:09:35 -08:00 коммит произвёл James Bottomley
Родитель e05a9e7b18
Коммит 6ce00cae68
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -3842,7 +3842,7 @@ int __init option_setup(char *str)
TRACE2(("option_setup() str %s\n", str ? str:"NULL")); 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); ints[i++] = simple_strtoul(cur, NULL, 0);
if ((cur = strchr(cur, ',')) != NULL) cur++; if ((cur = strchr(cur, ',')) != NULL) cur++;
} }