summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2017-02-27 09:33:00 +0800
committerHao Wu <hao.a.wu@intel.com>2017-02-28 08:57:52 +0800
commit24c6962d0988132c0a40dcc15f824dac02ef74b5 (patch)
tree91755b421d6155d915d9c7fb73f64f4aabb65254 /ShellPkg
parent9555c09717ee0b1ed4619942257c7b64aeb57f6e (diff)
downloadedk2-platforms-24c6962d0988132c0a40dcc15f824dac02ef74b5.tar.xz
ShellPkg/UefiDpLib: 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 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiDpLib/Dp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiDpLib/Dp.c b/ShellPkg/Library/UefiDpLib/Dp.c
index 33f69a0c14..35ead751be 100644
--- a/ShellPkg/Library/UefiDpLib/Dp.c
+++ b/ShellPkg/Library/UefiDpLib/Dp.c
@@ -272,7 +272,7 @@ ShellCommandRunDp (
// 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)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PERF_PROPERTY_NOT_FOUND), gDpHiiHandle);
goto Done;
}