diff --git a/Library/OcMemoryLib/MemoryAttributes.c b/Library/OcMemoryLib/MemoryAttributes.c index e0f00646..4e2c7f08 100644 --- a/Library/OcMemoryLib/MemoryAttributes.c +++ b/Library/OcMemoryLib/MemoryAttributes.c @@ -438,7 +438,7 @@ OcRebuildAttributes ( UINT32 DescriptorVersion; MemoryAttributesTable = OcGetMemoryAttributes (&MemoryAttributesEntry); - if (MemoryAttributesTable == NULL) { + if (MemoryAttributesTable == NULL || MemoryAttributesTable->NumberOfEntries == 0) { return EFI_UNSUPPORTED; }