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 867D9820A9 for ; Sun, 26 Feb 2017 17:38:42 -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:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,211,1484035200"; d="scan'208";a="69327194" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by orsmga005.jf.intel.com with ESMTP; 26 Feb 2017 17:38:41 -0800 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Star Zeng Date: Mon, 27 Feb 2017 09:38:35 +0800 Message-Id: <1488159516-8864-2-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 1/2] PerformancePkg/Dp_App: 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:42 -0000 Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- PerformancePkg/Dp_App/Dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PerformancePkg/Dp_App/Dp.c b/PerformancePkg/Dp_App/Dp.c index e2cb862..4cdc39e 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; } -- 1.9.5.msysgit.0