From e2c7d0f9196d0f5887adeed3b78e450759e205f9 Mon Sep 17 00:00:00 2001 From: belliash Date: Thu, 23 Feb 2023 00:39:13 +0100 Subject: [PATCH] Zero fill memory map before fetching it once again --- xtldr/i686/memory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xtldr/i686/memory.c b/xtldr/i686/memory.c index 39c16e1..dd67dc5 100644 --- a/xtldr/i686/memory.c +++ b/xtldr/i686/memory.c @@ -168,7 +168,7 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings, return Status; } - /* Iterate through and map all the mappings*/ + /* Iterate through and map all the mappings */ BlDbgPrint(L"Mapping and dumping EFI memory:\n"); ListEntry = MemoryMappings->Flink; while(ListEntry != MemoryMappings) @@ -197,6 +197,9 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings, ListEntry = ListEntry->Flink; } + /* Zero-fill buffer for EFI memory map */ + RtlZeroMemory(MemoryMap, sizeof(EFI_MEMORY_MAP)); + /* Get EFI memory map and prepare for exiting boot services */ BlDbgPrint(L"Exiting EFI boot services\n"); Status = BlGetMemoryMap(MemoryMap);