Added missing length check in urb_control_transfer

This commit is contained in:
akallabeth 2022-10-13 09:00:48 +02:00 committed by akallabeth
parent b366ff19a5
commit d9e687d7e1

View File

@ -686,7 +686,11 @@ static UINT urb_control_transfer(IUDEVICE* pdev, GENERIC_CHANNEL_CALLBACK* callb
buffer = Stream_Pointer(out); buffer = Stream_Pointer(out);
if (transferDir == USBD_TRANSFER_DIRECTION_OUT) if (transferDir == USBD_TRANSFER_DIRECTION_OUT)
{
if (!Stream_CheckAndLogRequiredLength(TAG, s, OutputBufferSize))
return ERROR_INVALID_DATA;
Stream_Copy(s, out, OutputBufferSize); Stream_Copy(s, out, OutputBufferSize);
}
/** process TS_URB_CONTROL_TRANSFER */ /** process TS_URB_CONTROL_TRANSFER */
if (!pdev->control_transfer(pdev, RequestId, EndpointAddress, TransferFlags, bmRequestType, if (!pdev->control_transfer(pdev, RequestId, EndpointAddress, TransferFlags, bmRequestType,