From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EE62682179 for ; Sun, 26 Feb 2017 17:38:43 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2017 17:38:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,211,1484035200"; d="scan'208";a="69327201" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by orsmga005.jf.intel.com with ESMTP; 26 Feb 2017 17:38:42 -0800 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Star Zeng Date: Mon, 27 Feb 2017 09:38:36 +0800 Message-Id: <1488159516-8864-3-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 In-Reply-To: <1488159516-8864-1-git-send-email-hao.a.wu@intel.com> References: <1488159516-8864-1-git-send-email-hao.a.wu@intel.com> Subject: [PATCH 2/2] ShellPkg/UefiDpLib: Add check to avoid NULL pointer dereference X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 01:38:44 -0000 Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- ShellPkg/Library/UefiDpLib/Dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiDpLib/Dp.c b/ShellPkg/Library/UefiDpLib/Dp.c index 33f69a0..35ead75 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; } -- 1.9.5.msysgit.0