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.
You can merge this Pull Request by running:

  git pull https://github.com/Lekensteyn/libusbx fix-string-desc

Or you can view, comment on it, or merge it online at:

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

-- Commit Summary --

  * Report error for bogus string descriptors

-- File Changes --

    M libusb/descriptor.c (5)
    M libusb/libusb.h (17)

-- Patch Links --

https://github.com/libusbx/libusbx/pull/156.patch
https://github.com/libusbx/libusbx/pull/156.diff
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to