gregkh/usbutils — pull request #20 by Lekensteyn (2013-11-04 18:17:09+00:00)
Title: Ignore invalid string descriptors

This Ralink Wi-Fi adapter reports bogus values for some string
descriptors (iSerial and iInterface). As the current
libusb_get_string_descriptor function from 1.0.17 does not validate the
length or type and returns 254 even if the descriptor says 0, explicitly
check the fields before proceeding.

Fixes the following crash:

lsusb: gconv.c:74: __gconv: Assertion `outbuf != ((void *)0) && *outbuf != ((void *)0)' failed.

libusbx bug: https://github.com/libusbx/libusbx/pull/156

Signed-off-by: Peter Wu