diff --git a/reactos/drivers/usb/usbd/usbd.c b/reactos/drivers/usb/usbd/usbd.c index 66ae4a1fb4c..d33d67fd0b4 100644 --- a/reactos/drivers/usb/usbd/usbd.c +++ b/reactos/drivers/usb/usbd/usbd.c @@ -351,15 +351,17 @@ USBD_GetInterfaceLength( PUCHAR BufferEnd ) { + ULONG_PTR Current; PUSB_INTERFACE_DESCRIPTOR CurrentDescriptor = InterfaceDescriptor; DWORD Length = CurrentDescriptor->bLength; // USB_ENDPOINT_DESCRIPTOR_TYPE if (CurrentDescriptor->bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE) { - for (; - (PUCHAR)CurrentDescriptor < BufferEnd; - (PVOID)CurrentDescriptor += CurrentDescriptor->bLength) + for (Current = (ULONG_PTR)CurrentDescriptor; + Current < (ULONG_PTR)BufferEnd; + Current += CurrentDescriptor->bLength) + CurrentDescriptor = (PUSB_INTERFACE_DESCRIPTOR)Current; Length += CurrentDescriptor->bLength; }