Skip to contentSkip to conversation

MIPS: Read buffer overflow

PATCH Applied Roel Kluin 2 participants 2 messages Jul 29, 2009 MIPS

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 MIPS: Read buffer overflow

it should tests against ARRAY_SIZE(psp_var_map) instead of sizeof(psp_var_map)

---
ARRAY_SIZE(psp_var_map) is 9.
sizeof(psp_var_map) is 144.

arch/mips/ar7/prom.c +1 -1
index a320bce..5ad6f1d 100644
@@ -144,7 +144,7 @@ static char * __init lookup_psp_var_map(u8 num)
 {
 	int i;
 
-	for (i = 0; i < sizeof(psp_var_map); i++)
+	for (i = 0; i < ARRAY_SIZE(psp_var_map); i++)
 		if (psp_var_map[i].num == num)
 			return psp_var_map[i].value;
 
Applied
#1 lore raw
Quoted 1 line · Roel Kluin

it should tests against ARRAY_SIZE(psp_var_map) instead of sizeof(psp_var_map)

Thanks, applied.

Ralf