libusbx/libusbx — pull request #156 by Lekensteyn (2013-11-04 18:01:41+00:00)
Title: Report error for bogus string descriptors

This Ralink device returns bogus values for some string descriptors
(iSerial, iInterface). The bDescriptorType and everything following that
changes every time, but at least the first byte stays consistently 0.
The USB 2.0 spec (9.6.7 String) does not define the behavior for
bLengths 0 and 1, so let's assume that string descriptors following that
are completely junk.

As the bDescriptorType check is done in libusb_get_string_descriptor, it
can be removed from libusb_get_string_descriptor_ascii.