]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg/UefiDpLib: Add check to avoid NULL pointer deference
authorHao Wu <hao.a.wu@intel.com>
Mon, 27 Feb 2017 01:33:00 +0000 (09:33 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 28 Feb 2017 00:57:52 +0000 (08:57 +0800)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
ShellPkg/Library/UefiDpLib/Dp.c

index 33f69a0c145a0df6132675db3b05b848feff0528..35ead751becced8ed7ea25f49d63823589574020 100644 (file)
@@ -272,7 +272,7 @@ ShellCommandRunDp (
   //      EndCount = Value counter counts to before it needs to be reset\r
   //\r
   Status = EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, (VOID **) &PerformanceProperty);\r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || (PerformanceProperty == NULL)) {\r
     ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PERF_PROPERTY_NOT_FOUND), gDpHiiHandle);\r
     goto Done;\r
   }\r