]> sigrok.org Git - libsigrok.git/commit
usb_get_port_path(): fix libusb error checking
authorVincent Palatin <redacted>
Mon, 10 Nov 2014 16:17:07 +0000 (08:17 -0800)
committerUwe Hermann <redacted>
Sun, 23 Nov 2014 16:58:21 +0000 (17:58 +0100)
commit2f004b4bc15c891b474adcba59a2224f009828af
tree454243559e80373a8418777fcbf0df9068a371bf
parent68ac991dbaa05ab91459419400b21b93f02d0e76
usb_get_port_path(): fix libusb error checking

When libusb cannot access a device, libusb_get_port_numbers() will return
an error. Check the return code rather than doing invalid pointer
operations (out-of-bound read).

Avoid segfaults at sigrok-cli startup on my setup where some USB devices are
not accessible and also make Valgrind happier.

Signed-off-by: Vincent Palatin <redacted>
src/usb.c