From 17efd446c00b414ddeb53ec00b85d780f2f09250 Mon Sep 17 00:00:00 2001 From: Shenglei Zhang Date: Tue, 15 Oct 2019 10:13:35 +0800 Subject: [PATCH] MdeModulePkg/Mem: Initialize the variable MapMemory MapMemory is not initialized by FindGuardedMemoryMap or CoreInternalAllocatePages which calls MapMemory. So we give a 0 to it. Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Shenglei Zhang Reviewed-by: Dandan Bi --- MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c index 9477b94044..b4cb48843f 100644 --- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c +++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c @@ -225,6 +225,8 @@ FindGuardedMemoryMap ( UINTN BitsToUnitEnd; EFI_STATUS Status; + MapMemory = 0; + // // Adjust current map table depth according to the address to access //