From 196b3167efd13a02cdd34acc1a12316b9f45f41d Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Thu, 1 Oct 2009 15:44:24 -0700 Subject: [PATCH] cyclades: fix read buffer overflow 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 Acked-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/cyclades.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index df5038bbcbc..4254457d391 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -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