Input: iforce - validate number of endpoints before using them
authorJohan Hovold <johan@kernel.org>
Thu, 16 Mar 2017 18:34:02 +0000 (11:34 -0700)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:03:28 +0000 (14:03 +0200)
commitf0819a498be8d63256dc176dc4de7b6286de7d47
tree8cb3d99f6c2c82de1dba0a9457a25be2978012d4
parent4fccf698ed2aef12f4e150b6ee090b92fc3e7c64
Input: iforce - validate number of endpoints before using them

commit 59cf8bed44a79ec42303151dd014fdb6434254bb upstream.

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer or accessing memory that lie beyond the end of the endpoint
array should a malicious device lack the expected endpoints.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/input/joystick/iforce/iforce-usb.c