[USBD]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 23 Oct 2012 04:54:37 +0000 (04:54 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 23 Oct 2012 04:54:37 +0000 (04:54 +0000)
- Don't assert on invalid usb descriptor
- Core-6574

svn path=/trunk/; revision=57598

reactos/drivers/usb/usbd/usbd.c

index df273ee..958f017 100644 (file)
@@ -474,8 +474,11 @@ USBD_ParseDescriptors(
            return CommonDescriptor;
        }
 
            return CommonDescriptor;
        }
 
-       /* sanity check */
-       ASSERT(CommonDescriptor->bLength);
+       if (CommonDescriptor->bLength == 0)
+       {
+           /* invalid usb descriptor */
+           return NULL;
+       }
 
        /* move to next descriptor */
        CommonDescriptor = (PUSB_COMMON_DESCRIPTOR)((ULONG_PTR)CommonDescriptor + CommonDescriptor->bLength);
 
        /* move to next descriptor */
        CommonDescriptor = (PUSB_COMMON_DESCRIPTOR)((ULONG_PTR)CommonDescriptor + CommonDescriptor->bLength);