HID: hid-steam: Better handling of serial number length
authorVicki Pfau <vi@endrift.com>
Wed, 20 Dec 2023 03:38:36 +0000 (19:38 -0800)
committerJiri Kosina <jkosina@suse.com>
Tue, 2 Jan 2024 10:20:43 +0000 (11:20 +0100)
commit43565b6788d46820da7d8f5ab1a595398419e914
treee7ac8ed777fcc3d4dc55ade45d82ee80ebd313f2
parent4f9a5a9769cc77075e606537e15747e8b8e9c7c9
HID: hid-steam: Better handling of serial number length

The second byte of the GET_STRING_ATTRIB report is a length, so we should set
the size of the buffer to be the size we're actually requesting, and only
reject the reply if the length out is nonsensical.

Signed-off-by: Vicki Pfau <vi@endrift.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-steam.c