]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiDpLib/Dp.c
ShellPkg/UefiDpLib: Add check to avoid NULL pointer deference
[mirror_edk2.git] / 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