“2ce2e4b2b56dd564d27e7aadb92ed0c2342a9c57”上不存在“...include/git@gitcode.net:openharmony/kernel_linux.git”
Input: turbografx - fix potential out of bound access
Patch 17dd3f0f: "[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: NDan Carpenter <dan.carpenter@oracle.com> Reviewed-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
Showing
想要评论请 注册 或 登录