]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Add ASSERT to make sure pointer 'MemoryMap' is not NULL.
authorQiu Shumin <shumin.qiu@intel.com>
Thu, 25 Feb 2016 05:00:28 +0000 (13:00 +0800)
committerQiu Shumin <shumin.qiu@intel.com>
Fri, 26 Feb 2016 06:59:22 +0000 (14:59 +0800)
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 <shumin.qiu@intel.com>
Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com>
MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c

index ebe70966db78fd9f32bdc84074c565b34072008c..32497c1c0c695898c20e41640d1f32d9400b9d09 100644 (file)
@@ -790,6 +790,7 @@ CoreGetMemoryMapPropertiesTable (
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
     *MemoryMapSize = *MemoryMapSize + (*DescriptorSize) * AdditionalRecordCount;\r
   } else if (Status == EFI_SUCCESS) {\r
+    ASSERT (MemoryMap != NULL);\r
     if (OldMemoryMapSize - *MemoryMapSize < (*DescriptorSize) * AdditionalRecordCount) {\r
       *MemoryMapSize = *MemoryMapSize + (*DescriptorSize) * AdditionalRecordCount;\r
       //\r