gregkh / usbutils

USB utilities for Linux, including lsusb
http://www.linux-usb.org
356 stars 202 forks source link

lsusb-t: Add lower bound checks in read_sysfs_file_string #121

Closed minhbq-99 closed 3 years ago

minhbq-99 commented 3 years ago

I have a USB device that returns "\n\n" in manufacturer field which makes newline cleanup in read_sysfs_file_string result in out-of-bound access.

Fix this by adding lower bound checks in the loops.

gregkh commented 3 years ago

thanks for the fix!