mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
MdePkg/SmmMemLib: Avoid possible NULL ptr dereference
Within function SmmMemLibInternalGetUefiMemoryAttributesTable(), add a check to avoid possible null pointer dereference. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
parent
39f0156fce
commit
264914a512
@ -439,7 +439,7 @@ SmmMemLibInternalGetUefiMemoryAttributesTable (
|
||||
UINTN MemoryAttributesTableSize;
|
||||
|
||||
Status = EfiGetSystemConfigurationTable (&gEfiMemoryAttributesTableGuid, (VOID **)&MemoryAttributesTable);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
if (!EFI_ERROR (Status) && (MemoryAttributesTable != NULL)) {
|
||||
MemoryAttributesTableSize = sizeof(EFI_MEMORY_ATTRIBUTES_TABLE) + MemoryAttributesTable->DescriptorSize * MemoryAttributesTable->NumberOfEntries;
|
||||
mSmmMemLibMemoryAttributesTable = AllocateCopyPool (MemoryAttributesTableSize, MemoryAttributesTable);
|
||||
ASSERT (mSmmMemLibMemoryAttributesTable != NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user