cyclades: fix read buffer overflow
Subsystems (2)
PATCH 3/5 cyclades: fix read buffer overflow
From: Roel Kluin <[email protected]>
irq is declared with size NR_CARDS (4), but the loop containing this segment runs up until NR_ISA_ADDRS (16), possibly reading from irq[i] (and trying to use the result)
Identified by the Parfait static scanner.
Signed-off-by Roel Kluin <[email protected]>
Acked-by Jiri Slaby <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/char/cyclades.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/cyclades.c renamed from drivers/char/cyclades.c~cyclades-read-buffer-overflow +1 -1
@@ -3354,7 +3354,7 @@ static int __init cy_detect_isa(void)continue ; }#ifdef MODULE -if (isparam && irq[i]) +if (isparam && i <NR_CARDS && irq[i]) cy_isa_irq = irq[i]; else#endif
_