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 <shumin.qiu@intel.com>
Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com>
This commit is contained in:
Qiu Shumin 2016-02-25 13:00:28 +08:00
parent ba33c80fc5
commit 4cb6375ca6
1 changed files with 1 additions and 0 deletions

View File

@ -790,6 +790,7 @@ CoreGetMemoryMapPropertiesTable (
if (Status == EFI_BUFFER_TOO_SMALL) { if (Status == EFI_BUFFER_TOO_SMALL) {
*MemoryMapSize = *MemoryMapSize + (*DescriptorSize) * AdditionalRecordCount; *MemoryMapSize = *MemoryMapSize + (*DescriptorSize) * AdditionalRecordCount;
} else if (Status == EFI_SUCCESS) { } else if (Status == EFI_SUCCESS) {
ASSERT (MemoryMap != NULL);
if (OldMemoryMapSize - *MemoryMapSize < (*DescriptorSize) * AdditionalRecordCount) { if (OldMemoryMapSize - *MemoryMapSize < (*DescriptorSize) * AdditionalRecordCount) {
*MemoryMapSize = *MemoryMapSize + (*DescriptorSize) * AdditionalRecordCount; *MemoryMapSize = *MemoryMapSize + (*DescriptorSize) * AdditionalRecordCount;
// //