HID: logitech-hidpp: add boundary check for name retrieval
authorPeter Wu <peter@lekensteyn.nl>
Thu, 11 Dec 2014 12:51:19 +0000 (13:51 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 11 Dec 2014 22:10:00 +0000 (23:10 +0100)
commit3a034a7a7d61c30809255c1fc27d47d52c8c1bb6
tree0d86115c4a291314da2f6ddb52521cba9c782d43
parent1430ee73b566a30bc210501d1e0e99c519707f1e
HID: logitech-hidpp: add boundary check for name retrieval

The HID response has a limited size. Do not trust the value returned by
hardware, check that it really fits in the message.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-logitech-hidpp.c