https://git.reactos.org/?p=reactos.git;a=commitdiff;h=376fbc524227d278604f252dc86ec715e968bec2

commit 376fbc524227d278604f252dc86ec715e968bec2
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Thu Jun 17 16:45:28 2021 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Mon Jun 28 10:20:57 2021 +0200

    [NTOS:MM] Check result of RtlCreateUnicodeString in MmGetFileNameForAddress
    
    CORE-17637
---
 ntoskrnl/mm/ARM3/section.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ntoskrnl/mm/ARM3/section.c b/ntoskrnl/mm/ARM3/section.c
index fa4bb52d999..4a65209d38b 100644
--- a/ntoskrnl/mm/ARM3/section.c
+++ b/ntoskrnl/mm/ARM3/section.c
@@ -1927,11 +1927,13 @@ MmGetFileNameForAddress(IN PVOID Address,
     if (NT_SUCCESS(Status))
     {
         /* Init modulename */
-        RtlCreateUnicodeString(ModuleName, ModuleNameInformation->Name.Buffer);
+        if (!RtlCreateUnicodeString(ModuleName, 
ModuleNameInformation->Name.Buffer))
+            Status = STATUS_INSUFFICIENT_RESOURCES;
 
         /* Free temp taged buffer from MmGetFileNameForFileObject() */
         ExFreePoolWithTag(ModuleNameInformation, TAG_MM);
-        DPRINT("Found ModuleName %S by address %p\n", ModuleName->Buffer, 
Address);
+
+        DPRINT("Found ModuleName %wZ by address %p\n", ModuleName, Address);
     }
 
    /* Return status */

Reply via email to