[NTOS:PNP] Reduce the size of the pool buffer in IopGetParentIdPrefix. CORE-15882 1507/head
authorThomas Faber <thomas.faber@reactos.org>
Thu, 18 Apr 2019 05:41:50 +0000 (07:41 +0200)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 5 May 2019 08:39:29 +0000 (10:39 +0200)
ntoskrnl/io/pnpmgr/pnpmgr.c

index b4f59f4..e5530c6 100644 (file)
@@ -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);