]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Gcd/Gcd.c
MdeModulePkg/Core: fix an issue of potential NULL pointer access
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Gcd / Gcd.c
index 8bbdf7129f0f50a994ca56b3425c420d1889810b..a76d2db73c469fb6e135199430784dce319c620f 100644 (file)
@@ -1719,7 +1719,7 @@ CoreGetMemorySpaceMap (
     // AllocatePool() called below has to be running outside the GCD lock.\r
     //\r
     DescriptorCount = CoreCountGcdMapEntry (&mGcdMemorySpaceMap);\r
-    if (DescriptorCount == *NumberOfDescriptors) {\r
+    if (DescriptorCount == *NumberOfDescriptors && *MemorySpaceMap != NULL) {\r
       //\r
       // Fill in the MemorySpaceMap if no memory space map change.\r
       //\r