[USBPORT] Avoid a benign integer overflow in USBHI_QueryDeviceInformation (CID 1419219).

This commit is contained in:
Thomas Faber 2017-10-11 17:59:43 +02:00 committed by Thomas Faber
parent 45741cdf3a
commit a45779a12f

View file

@ -211,8 +211,8 @@ USBHI_QueryDeviceInformation(IN PVOID BusContext,
}
}
ActualLength = sizeof(USB_DEVICE_INFORMATION_0) +
(NumberOfOpenPipes - 1) * sizeof(USB_PIPE_INFORMATION_0);
ActualLength = FIELD_OFFSET(USB_DEVICE_INFORMATION_0, PipeList) +
NumberOfOpenPipes * sizeof(USB_PIPE_INFORMATION_0);
if (DeviceInfoBufferLen < ActualLength)
{