]> Pileus Git - ~andy/linux/commitdiff
[PATCH] drivers/input/joystick/spaceorb.c: fix an array overflow
authorAdrian Bunk <bunk@stusta.de>
Sun, 1 May 2005 15:59:30 +0000 (08:59 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 1 May 2005 15:59:30 +0000 (08:59 -0700)
This patch fixes an array overflow found by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/input/joystick/spaceorb.c

index c76cf8ff29c0df6d1617eb8bd0dae2d15671e516..874367bfab0860c4f389544f3039481c5875c82d 100644 (file)
@@ -116,7 +116,7 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb, struct pt_regs *r
 
                case 'K':                               /* Button data */
                        if (spaceorb->idx != 5) return;
-                       for (i = 0; i < 7; i++)
+                       for (i = 0; i < 6; i++)
                                input_report_key(dev, spaceorb_buttons[i], (data[2] >> i) & 1);
 
                        break;