[NTOS] Use correct buffer size when calling MiResolveImageReferences. CORE-15882
authorThomas Faber <thomas.faber@reactos.org>
Mon, 15 Apr 2019 06:25:23 +0000 (08:25 +0200)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 5 May 2019 08:39:11 +0000 (10:39 +0200)
ntoskrnl/io/iomgr/driver.c
ntoskrnl/mm/ARM3/sysldr.c

index 49422e0..f636dc3 100644 (file)
@@ -735,7 +735,9 @@ LdrProcessDriverModule(PLDR_DATA_TABLE_ENTRY LdrEntry,
     PVOID DriverBase = LdrEntry->DllBase;
 
     /* Allocate a buffer we'll use for names */
     PVOID DriverBase = LdrEntry->DllBase;
 
     /* Allocate a buffer we'll use for names */
-    Buffer = ExAllocatePoolWithTag(NonPagedPool, MAX_PATH, TAG_LDR_WSTR);
+    Buffer = ExAllocatePoolWithTag(NonPagedPool,
+                                   MAXIMUM_FILENAME_LENGTH,
+                                   TAG_LDR_WSTR);
     if (!Buffer)
     {
         /* Fail */
     if (!Buffer)
     {
         /* Fail */
index 4c2ffda..6408566 100644 (file)
@@ -2793,7 +2793,9 @@ MmLoadSystemImage(IN PUNICODE_STRING FileName,
     }
 
     /* Allocate a buffer we'll use for names */
     }
 
     /* Allocate a buffer we'll use for names */
-    Buffer = ExAllocatePoolWithTag(NonPagedPool, MAX_PATH, TAG_LDR_WSTR);
+    Buffer = ExAllocatePoolWithTag(NonPagedPool,
+                                   MAXIMUM_FILENAME_LENGTH,
+                                   TAG_LDR_WSTR);
     if (!Buffer) return STATUS_INSUFFICIENT_RESOURCES;
 
     /* Check for a separator */
     if (!Buffer) return STATUS_INSUFFICIENT_RESOURCES;
 
     /* Check for a separator */