From: Hao Wu Date: Mon, 27 Feb 2017 01:33:00 +0000 (+0800) Subject: ShellPkg/UefiDpLib: Add check to avoid NULL pointer deference X-Git-Tag: edk2-stable201903~4545 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=24c6962d0988132c0a40dcc15f824dac02ef74b5;p=mirror_edk2.git ShellPkg/UefiDpLib: 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/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; }