public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Add check to avoid NULL ptr dereference
@ 2016-12-20  1:41 Hao Wu
  2016-12-20  1:42 ` Yao, Jiewen
  0 siblings, 1 reply; 6+ messages in thread
From: Hao Wu @ 2016-12-20  1:41 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao Wu, Jiewen Yao, Jeff Fan, Michael Kinney

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
index f4716f3..11fb891 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
@@ -1011,6 +1011,10 @@ GetUefiMemoryMap (
     }
   } while (Status == EFI_BUFFER_TOO_SMALL);
 
+  if (MemoryMap == NULL) {
+    return ;
+  }
+
   SortMemoryMap (MemoryMap, UefiMemoryMapSize, mUefiDescriptorSize);
   MergeMemoryMapForNotPresentEntry (MemoryMap, &UefiMemoryMapSize, mUefiDescriptorSize);
 
-- 
1.9.5.msysgit.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-12-20  2:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-20  1:41 [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Add check to avoid NULL ptr dereference Hao Wu
2016-12-20  1:42 ` Yao, Jiewen
2016-12-20  1:53   ` Kinney, Michael D
2016-12-20  2:02     ` Yao, Jiewen
2016-12-20  2:06       ` Yao, Jiewen
2016-12-20  2:23         ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox