descriptor.c: Read a full config-desc-header on first config-desc read
commit25b314279a6774198cf6de4170c76f458ebc89a2
authorHans de Goede <hdegoede@redhat.com>
Thu, 23 May 2013 13:20:12 +0000 (23 15:20 +0200)
committerHans de Goede <hdegoede@redhat.com>
Fri, 24 May 2013 11:58:37 +0000 (24 13:58 +0200)
tree8925cae0419b8560e8f84e54acbf5089bc2e8c10
parentbbe25fac47c2dfd2d50a2c3a1b0ed96473d8dc1c
descriptor.c: Read a full config-desc-header on first config-desc read

For some reason the first get config call to determine the total-length
was only reading 8 of the 9 bytes of a full config-desc-header, which
is weird. The Linux kernel reads the full 9 on the first call, so lets
do that in libusb too. Note that for backends which cache the config this
does not matter.

Also check that we've actually gotten back a full header, before parsing it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
libusb/descriptor.c
libusb/version_nano.h