Explorar o código

slram: Read buffer overflow

map[count] is checked before count < SLRAM_MAX_DEVICES_PARAMS

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Roel Kluin %!s(int64=16) %!d(string=hai) anos
pai
achega
269c0ee663
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/mtd/devices/slram.c

+ 1 - 1
drivers/mtd/devices/slram.c

@@ -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++) {
 	}