Skip to content

Commit

Permalink
[SCSI] gdth: fix buffer overflow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and James Bottomley committed Apr 11, 2010
1 parent e05a9e7 commit 6ce00ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/gdth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit 6ce00ca

Please sign in to comment.