Skip to contentSkip to conversation

u14-34f: Buffer overflow

PATCH New Roel Kluin 1 participant 1 message Jul 28, 2009 SCSI

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 u14-34f: Buffer overflow

This allows i == MAX_INT_PARAM, which is out of range for ints[]

---
Found with Parfait, http://research.sun.com/projects/parfait/

drivers/scsi/u14-34f.c +1 -1
index 54023d4..26e8e0e 100644
@@ -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++;