udev-builtin-usb_id: guard against overflow when reading descriptor data
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 28 Feb 2019 10:57:51 +0000 (11:57 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 28 Feb 2019 10:57:51 +0000 (11:57 +0100)
commit760034bebed2c4cfc8a6b114a207f817b2e61db3
tree958385f0ba50107855213a8a352e87cd080eae76
parent8bdca77c407d100b8c81e2108aba47a8810ead88
udev-builtin-usb_id: guard against overflow when reading descriptor data

CID#996458. Coverity warns that we trust desc->bLength as read in
the input data to adjust our position in the buffer. This value could
be anything, leading to overflow. It's unlikely that the kernel feeds
us invalid data, but let's me more careful.

If any error is encountered, more logs are given.
src/udev/udev-builtin-usb_id.c