From 4cb6375ca6ddf73577758a72b1464896c3eae767 Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Thu, 25 Feb 2016 13:00:28 +0800 Subject: [PATCH] MdeModulePkg: Add ASSERT to make sure pointer 'MemoryMap' is not NULL. If 'CoreGetMemoryMap' return success the 'MemoryMap' shouldn't be NULL. Add code to make sure this. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Yao Jiewen --- MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c index ebe70966db..32497c1c0c 100644 --- a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c +++ b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c @@ -790,6 +790,7 @@ CoreGetMemoryMapPropertiesTable ( if (Status == EFI_BUFFER_TOO_SMALL) { *MemoryMapSize = *MemoryMapSize + (*DescriptorSize) * AdditionalRecordCount; } else if (Status == EFI_SUCCESS) { + ASSERT (MemoryMap != NULL); if (OldMemoryMapSize - *MemoryMapSize < (*DescriptorSize) * AdditionalRecordCount) { *MemoryMapSize = *MemoryMapSize + (*DescriptorSize) * AdditionalRecordCount; // -- 2.39.2