summaryrefslogtreecommitdiffstats
path: root/PerformancePkg
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2017-02-27 09:26:27 +0800
committerHao Wu <hao.a.wu@intel.com>2017-02-28 08:57:43 +0800
commit9555c09717ee0b1ed4619942257c7b64aeb57f6e (patch)
treec88d55a5bb07c584cf9cbd4716dcd0280b3879fd /PerformancePkg
parent14e3b94964ae953b6e1dbc672218edf5e5b26bbe (diff)
downloadedk2-9555c09717ee0b1ed4619942257c7b64aeb57f6e.tar.gz
edk2-9555c09717ee0b1ed4619942257c7b64aeb57f6e.tar.bz2
edk2-9555c09717ee0b1ed4619942257c7b64aeb57f6e.zip
PerformancePkg/Dp_App: Add check to avoid NULL pointer deference
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>
Diffstat (limited to 'PerformancePkg')
-rw-r--r--PerformancePkg/Dp_App/Dp.c2
1 files changed, 1 insertions, 1 deletions
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;
}