Blame SOURCES/Fixed-missing-stream-length-check-in-drive_file_quer.patch

083b3c
From 80b2483373c00baec3a26b1d82027f16dfdd8859 Mon Sep 17 00:00:00 2001
083b3c
From: akallabeth <akallabeth@posteo.net>
083b3c
Date: Mon, 24 Oct 2022 08:45:05 +0200
083b3c
Subject: [PATCH] Fixed missing stream length check in
083b3c
 drive_file_query_directory
083b3c
083b3c
(cherry picked from commit 4e4bb79795d6ac85473fb7a83e53ccf63d204b93)
083b3c
---
083b3c
 channels/drive/client/drive_main.c | 3 +++
083b3c
 1 file changed, 3 insertions(+)
083b3c
083b3c
diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c
083b3c
index d3776381c..b6cf2ad32 100644
083b3c
--- a/channels/drive/client/drive_main.c
083b3c
+++ b/channels/drive/client/drive_main.c
083b3c
@@ -629,6 +629,9 @@ static UINT drive_process_irp_query_directory(DRIVE_DEVICE* drive, IRP* irp)
083b3c
 	Stream_Read_UINT32(irp->input, PathLength);
083b3c
 	Stream_Seek(irp->input, 23); /* Padding */
083b3c
 	path = (WCHAR*)Stream_Pointer(irp->input);
083b3c
+	if (!Stream_CheckAndLogRequiredLength(TAG, irp->input, PathLength))
083b3c
+		return ERROR_INVALID_DATA;
083b3c
+
083b3c
 	file = drive_get_file_by_id(drive, irp->FileId);
083b3c
 
083b3c
 	if (file == NULL)
083b3c
-- 
083b3c
2.37.1
083b3c