Sophie

Sophie

distrib > Fedora > 13 > x86_64 > by-pkgid > 26412eff1a3555ef95ab418e6a5de1b4 > files > 2

libusb-0.1.12-23.fc13.src.rpm

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