From a45779a12f70f3c43a5b78c7bdf3478c71accccb Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 11 Oct 2017 17:59:43 +0200 Subject: [PATCH] [USBPORT] Avoid a benign integer overflow in USBHI_QueryDeviceInformation (CID 1419219). --- drivers/usb/usbport/iface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbport/iface.c b/drivers/usb/usbport/iface.c index 39f42e77bab..4e56811eb7a 100644 --- a/drivers/usb/usbport/iface.c +++ b/drivers/usb/usbport/iface.c @@ -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) {