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>
This commit is contained in:
Hao Wu 2017-02-27 09:33:00 +08:00
parent 9555c09717
commit 24c6962d09
1 changed files with 1 additions and 1 deletions

View File

@ -272,7 +272,7 @@ ShellCommandRunDp (
// EndCount = Value counter counts to before it needs to be reset // EndCount = Value counter counts to before it needs to be reset
// //
Status = EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, (VOID **) &PerformanceProperty); 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); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PERF_PROPERTY_NOT_FOUND), gDpHiiHandle);
goto Done; goto Done;
} }