aeb96c5
diff -ru libusb-0.1.12.orig/descriptors.c libusb-0.1.12/descriptors.c
aeb96c5
--- libusb-0.1.12.orig/descriptors.c	2006-03-04 02:52:46.000000000 +0000
aeb96c5
+++ libusb-0.1.12/descriptors.c	2010-02-16 17:31:42.000000000 +0000
aeb96c5
@@ -235,11 +235,12 @@
aeb96c5
     }
aeb96c5
 
aeb96c5
     /* Did we hit an unexpected descriptor? */
aeb96c5
-    usb_parse_descriptor(buffer, "bb", &header);
aeb96c5
-    if ((size >= DESC_HEADER_LENGTH) &&
aeb96c5
-        ((header.bDescriptorType == USB_DT_CONFIG) ||
aeb96c5
-        (header.bDescriptorType == USB_DT_DEVICE)))
aeb96c5
-      return parsed;
aeb96c5
+    if (size >= DESC_HEADER_LENGTH) {
aeb96c5
+      usb_parse_descriptor(buffer, "bb", &header);
aeb96c5
+      if (((header.bDescriptorType == USB_DT_CONFIG) ||
aeb96c5
+          (header.bDescriptorType == USB_DT_DEVICE)))
aeb96c5
+        return parsed;
aeb96c5
+    }
aeb96c5
 
aeb96c5
     if (ifp->bNumEndpoints > USB_MAXENDPOINTS) {
aeb96c5
       if (usb_debug >= 1)