From: Hao Wu Date: Mon, 27 Feb 2017 01:26:27 +0000 (+0800) Subject: PerformancePkg/Dp_App: Add check to avoid NULL pointer deference X-Git-Tag: edk2-stable201903~4546 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=9555c09717ee0b1ed4619942257c7b64aeb57f6e PerformancePkg/Dp_App: Add check to avoid NULL pointer deference Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Star Zeng --- diff --git a/PerformancePkg/Dp_App/Dp.c b/PerformancePkg/Dp_App/Dp.c index e2cb862364..4cdc39edb4 100644 --- a/PerformancePkg/Dp_App/Dp.c +++ b/PerformancePkg/Dp_App/Dp.c @@ -400,7 +400,7 @@ InitializeDp ( // EndCount = Value counter counts to before it needs to be reset // Status = EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, (VOID **) &PerformanceProperty); - if (EFI_ERROR (Status)) { + if (EFI_ERROR (Status) || (PerformanceProperty == NULL)) { PrintToken (STRING_TOKEN (STR_PERF_PROPERTY_NOT_FOUND)); goto Done; }