From: Shenglei Zhang Date: Tue, 15 Oct 2019 02:13:35 +0000 (+0800) Subject: MdeModulePkg/Mem: Initialize the variable MapMemory X-Git-Tag: edk2-stable201911~87 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=17efd446c00b414ddeb53ec00b85d780f2f09250;p=mirror_edk2.git 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 --- 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 //