Blame SOURCES/Added-missing-length-check-in-urb_control_transfer.patch

087af1
From 8c513f127549433c830575202d1551b0e9dd182d Mon Sep 17 00:00:00 2001
087af1
From: akallabeth <akallabeth@posteo.net>
087af1
Date: Thu, 13 Oct 2022 09:00:48 +0200
087af1
Subject: [PATCH] Added missing length check in urb_control_transfer
087af1
087af1
(cherry picked from commit ce838e2477cb8173ea5e98f35ad55ff41ea5117d)
087af1
---
087af1
 channels/urbdrc/client/data_transfer.c | 4 ++++
087af1
 1 file changed, 4 insertions(+)
087af1
087af1
diff --git a/channels/urbdrc/client/data_transfer.c b/channels/urbdrc/client/data_transfer.c
087af1
index 9a44e6e09..bb2784055 100644
087af1
--- a/channels/urbdrc/client/data_transfer.c
087af1
+++ b/channels/urbdrc/client/data_transfer.c
087af1
@@ -673,7 +673,11 @@ static UINT urb_control_transfer(IUDEVICE* pdev, URBDRC_CHANNEL_CALLBACK* callba
087af1
 	buffer = Stream_Pointer(out);
087af1
 
087af1
 	if (transferDir == USBD_TRANSFER_DIRECTION_OUT)
087af1
+	{
087af1
+		if (!Stream_CheckAndLogRequiredLength(TAG, s, OutputBufferSize))
087af1
+			return ERROR_INVALID_DATA;
087af1
 		Stream_Copy(s, out, OutputBufferSize);
087af1
+	}
087af1
 
087af1
 	/**  process TS_URB_CONTROL_TRANSFER */
087af1
 	if (!pdev->control_transfer(pdev, RequestId, EndpointAddress, TransferFlags, bmRequestType,
087af1
-- 
087af1
2.37.1
087af1