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)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:17:08 +0000 (13:17 +0000)
commit456ecf559fb30bbc937329fb86462e2512f9348b
tree43f20b37a7bf9a36a1ce281ec3c8671cdaee38d1
parentde965ba2c79d8e2e16d9c1390cba28a8bcd19e32
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