Commit 196b3167efd13a02cdd34acc1a12316b9f45f41d

Authored by Roel Kluin
Committed by Linus Torvalds
1 parent 75e3a6aed9

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 <roel.kluin@gmail.com>
Acked-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/char/cyclades.c
... ... @@ -3354,7 +3354,7 @@
3354 3354 continue;
3355 3355 }
3356 3356 #ifdef MODULE
3357   - if (isparam && irq[i])
  3357 + if (isparam && i < NR_CARDS && irq[i])
3358 3358 cy_isa_irq = irq[i];
3359 3359 else
3360 3360 #endif