https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5706f6e9f4b237ada8098938ca2d4580f28d458a

commit 5706f6e9f4b237ada8098938ca2d4580f28d458a
Author:     Thomas Faber <[email protected]>
AuthorDate: Thu Apr 18 07:41:50 2019 +0200
Commit:     Thomas Faber <[email protected]>
CommitDate: Sun May 5 10:39:29 2019 +0200

    [NTOS:PNP] Reduce the size of the pool buffer in IopGetParentIdPrefix. 
CORE-15882
---
 ntoskrnl/io/pnpmgr/pnpmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c
index b4f59f4d17..e5530c6171 100644
--- a/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -1853,7 +1853,7 @@ IopGetParentIdPrefix(PDEVICE_NODE DeviceNode,
     }
 
     /* 1. Try to retrieve ParentIdPrefix from registry */
-    KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) 
+ MAX_PATH * sizeof(WCHAR);
+    KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data) + 
sizeof(L"12345678&12345678");
     ParentIdPrefixInformation = ExAllocatePoolWithTag(PagedPool,
                                                       KeyNameBufferLength + 
sizeof(UNICODE_NULL),
                                                       TAG_IO);

Reply via email to