diff options
author | Jiri Kosina <jkosina@suse.cz> | 2014-08-21 18:57:48 +0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-08-21 19:43:28 +0400 |
commit | 4ab25786c87eb20857bbb715c3ae34ec8fd6a214 (patch) | |
tree | a1f0b37bd3f77e369398df733e76c222f0a8f86d /drivers/hid/hid-petalynx.c | |
parent | ad3e14d7c5268c2e24477c6ef54bbdf88add5d36 (diff) | |
download | linux-4ab25786c87eb20857bbb715c3ae34ec8fd6a214.tar.xz |
HID: fix a couple of off-by-ones
There are a few very theoretical off-by-one bugs in report descriptor size
checking when performing a pre-parsing fixup. Fix those.
Cc: stable@vger.kernel.org
Reported-by: Ben Hawkes <hawkes@google.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-petalynx.c')
-rw-r--r-- | drivers/hid/hid-petalynx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-petalynx.c b/drivers/hid/hid-petalynx.c index 736b2502df4f..6aca4f2554bf 100644 --- a/drivers/hid/hid-petalynx.c +++ b/drivers/hid/hid-petalynx.c @@ -25,7 +25,7 @@ static __u8 *pl_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { - if (*rsize >= 60 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 && + if (*rsize >= 62 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 && rdesc[41] == 0x00 && rdesc[59] == 0x26 && rdesc[60] == 0xf9 && rdesc[61] == 0x00) { hid_info(hdev, "fixing up Petalynx Maxter Remote report descriptor\n"); |