Skip to contentSkip to conversation

slram: Read buffer overflow

PATCH New Roel Kluin 1 participant 1 message Jul 31, 2009 Memory technology devices (MTD)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 slram: Read buffer overflow

map[count] is checked before count < SLRAM_MAX_DEVICES_PARAMS

---
declared on drivers/mtd/devices/slram.c:66:

static char *map[SLRAM_MAX_DEVICES_PARAMS];

drivers/mtd/devices/slram.c +1 -1
index 00248e8..239500b 100644
@@ -341,7 +341,7 @@ static int init_slram(void)
 #else
 	int count;
 
-	for (count = 0; (map[count]) && (count < SLRAM_MAX_DEVICES_PARAMS);
+	for (count = 0; count < SLRAM_MAX_DEVICES_PARAMS && map[count];
 			count++) {
 	}