- Don't assert on invalid usb descriptor
- Core-6574

svn path=/trunk/; revision=57598
This commit is contained in:
Johannes Anderwald 2012-10-23 04:54:37 +00:00
parent ed3d75f9de
commit d1e0226d49

View file

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