diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-07-30 18:01:13 (GMT) |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-08-03 21:11:45 (GMT) |
commit | c20bc5502d151ca731ebc672b95aa77e2bf32c8c (patch) | |
tree | 0cfbf09be90866e7d1988227987b43dbbab53985 /kernel/elfcore.c | |
parent | 3213afb8bf5cf8d8c68a2c2376bf1dda52afae5d (diff) | |
download | linux-c20bc5502d151ca731ebc672b95aa77e2bf32c8c.tar.xz |
Input: turbografx - fix potential out of bound access
Patch 17dd3f0f7aa7: "[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>
Diffstat (limited to 'kernel/elfcore.c')
0 files changed, 0 insertions, 0 deletions