PerformancePkg/Dp_App: Add check to avoid NULL pointer deference
authorHao Wu <hao.a.wu@intel.com>
Mon, 27 Feb 2017 01:26:27 +0000 (09:26 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 28 Feb 2017 00:57:43 +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>
PerformancePkg/Dp_App/Dp.c

index e2cb862..4cdc39e 100644 (file)
@@ -400,7 +400,7 @@ InitializeDp (
       //      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
         PrintToken (STRING_TOKEN (STR_PERF_PROPERTY_NOT_FOUND));\r
         goto Done;\r
       }\r