提交 196b3167 编写于 作者: R Roel Kluin 提交者: Linus Torvalds

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: NRoel Kluin <roel.kluin@gmail.com>
Acked-by: NJiri Slaby <jirislaby@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 75e3a6ae
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册