linux/drivers/input
Dmitry Torokhov c20bc5502d Input: turbografx - fix potential out of bound access
Patch 17dd3f0f7a: "[PATCH] drivers/input/joystick: convert to dynamic
input_dev allocation" from Sep 15, 2005, leads to the following static
checker warning:

        drivers/input/joystick/turbografx.c:235 tgfx_probe()
        error: buffer overflow 'tgfx_buttons' 5 <= 5

drivers/input/joystick/turbografx.c
   195          for (i = 0; i < n_devs; i++) {
   196                  if (n_buttons[i] < 1)
   197                          continue;
   198
   199                  if (n_buttons[i] > 6) {
                            ^^^^^^^^^^^^^^^^
Possibly off by one.  >= 6.

Let's change the upper value to ARRAY_SIZE(tgfx_buttons) to ensure we do
not reach past the end of the array.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-08-03 14:11:45 -07:00
..
gameport Input: initialize device counter variables with -1 2014-12-03 15:27:17 -08:00
joystick Input: turbografx - fix potential out of bound access 2015-08-03 14:11:45 -07:00
keyboard Input: imx_keypad - check for clk_prepare_enable() error 2015-06-22 09:33:51 -07:00
misc Input: axp20x-pek - fix reporting button state as inverted 2015-06-24 14:55:53 -07:00
mouse Input: bcm5974 - add support for the 2015 Macbook Pro 2015-07-27 15:43:47 -07:00
serio Input: arc_ps2 - add HAS_IOMEM dependency 2015-06-29 12:57:05 -07:00
tablet Input: gtco - use sign_extend32() for sign extension 2015-01-26 23:07:45 -08:00
touchscreen Revert "Input: zforce - don't overwrite the stack" 2015-07-28 10:25:03 -07:00
apm-power.c
evbug.c
evdev.c Input: evdev - use kvfree() in evdev_release() 2015-05-15 15:58:39 -07:00
ff-core.c Input: ff-core - fix typo in comment to input_ff_erase() 2015-05-20 14:45:42 -07:00
ff-memless.c
input-compat.c
input-compat.h
input-leds.c Input: LEDs - skip unnamed LEDs 2015-07-24 09:11:01 -07:00
input-mt.c Input: MT - make slot assignment work for overcovered solutions 2015-04-06 09:37:33 -07:00
input-polldev.c Input: implement managed polled input devices 2014-05-14 16:40:04 -07:00
input.c Input: use for_each_set_bit() where appropriate 2015-06-25 14:44:36 -07:00
joydev.c Input: joydev - don't classify the vmmouse as a joystick 2015-05-21 15:58:27 -07:00
Kconfig Input: export LEDs as class devices in sysfs 2015-06-11 18:18:11 -07:00
Makefile Input: export LEDs as class devices in sysfs 2015-06-11 18:18:11 -07:00
matrix-keymap.c
mousedev.c Input: mousedev - fix race when creating mixed device 2014-03-29 14:44:23 -07:00
sparse-keymap.c treewide: Fix typo in Documentation/DocBook 2014-02-19 14:58:17 +01:00