From nobody Sun May 5 13:46:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+46673+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46673+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1567427701; cv=none; d=zoho.com; s=zohoarc; b=l5aQnlUW92o4dDMGYbPFORVBAfZblfD/dDzIECf3KJ9crTi5PxlR7YVFKeb4ajpx1Cfh8qK6zjzQnXxczShMjr5+d2Lb/cMxPtQOOHZ3E6HEoY0JY7RdSBvUC8Uzci9zcC1Am+VexQ01E4vrI4UhKAaPrmj756+BlwfFNPsFvmg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567427701; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=Hjn927UKHesT1qSXuNjGynvKbHWzlyP/S0ROvx5/lTc=; b=kitPa65WXF2DIhLpq0T2e6YajSo6pFldyjcMjFWiRJV0J54rFuAb71U4bnVvfnkKItIfJdJURE9fmx8QetItz0WjIezdgXF3rwyuTXG19uJJT2jnlcCYnLyyz3tz+eAWcsT7MVuykKOGh9FNB7naqFn+Gr+dLlvOW46823Yz+c0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46673+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1567427701863538.1555170607247; Mon, 2 Sep 2019 05:35:01 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com []) by groups.io with SMTP; Mon, 02 Sep 2019 05:35:01 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2019 05:35:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,459,1559545200"; d="scan'208";a="186990359" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga006.jf.intel.com with ESMTP; 02 Sep 2019 05:34:59 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone , Liming Gao Subject: [edk2-devel] [PATCH] MinPlatformPkg/TestPointCheckLib: Add check for pointer Variable Date: Mon, 2 Sep 2019 20:34:52 +0800 Message-Id: <20190902123452.27716-4-shenglei.zhang@intel.com> In-Reply-To: <20190902123452.27716-1-shenglei.zhang@intel.com> References: <20190902123452.27716-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shenglei.zhang@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1567427701; bh=f1PP1HEgPlVhi5YtCaXwRLCkSul80tZFOCzlt2TEUCA=; h=Cc:Date:From:Reply-To:Subject:To; b=qr4hLm6gV1Nlau36fMZ7Wu7n4+5ew4E5jpbZQHN44CJDHuTrWU7ZqBwT75zTDqgF8CZ e22m11SN+8hOHOJJVZBg6tccs61/3UJJ8STCyAcL61Cjt0OUE0QF7vAGIyEPzWpu+oG3c RNgzp5zExHzAzpN3n0wGhRCLwYCEIJ8/Qy8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add check for pointer Variable to ensure it is not NULL when used. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- .../Test/Library/TestPointCheckLib/DxeCheckUefiSecureBoot.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeCheckUefiSecureBoot.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPo= intCheckLib/DxeCheckUefiSecureBoot.c index b53a09ab..f5125ede 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= UefiSecureBoot.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= UefiSecureBoot.c @@ -52,6 +52,9 @@ TestPointCheckUefiSecureBoot ( ReturnStatus =3D EFI_SUCCESS; for (Index =3D 0; Index < sizeof(mUefiSecureBootVariable)/sizeof(mUefiSe= cureBootVariable[0]); Index++) { Status =3D GetVariable2 (mUefiSecureBootVariable[Index].Name, mUefiSec= ureBootVariable[Index].Guid, &Variable, &Size); + if(Variable =3D=3D NULL) { + return EFI_NOT_FOUND; + } if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Variable - %S not found\n", mUefiSecureBootVar= iable[Index].Name)); ReturnStatus =3D Status; @@ -69,6 +72,9 @@ TestPointCheckUefiSecureBoot ( =20 for (Index =3D 0; Index < sizeof(mUefiSecureBootModeVariable)/sizeof(mUe= fiSecureBootModeVariable[0]); Index++) { Status =3D GetVariable2 (mUefiSecureBootModeVariable[Index].Name, mUef= iSecureBootModeVariable[Index].Guid, &Variable, &Size); + if(Variable =3D=3D NULL) { + return EFI_NOT_FOUND; + } if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Variable - %S not found\n", mUefiSecureBootMod= eVariable[Index].Name)); ReturnStatus =3D Status; --=20 2.18.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46673): https://edk2.groups.io/g/devel/message/46673 Mute This Topic: https://groups.io/mt/33110622/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-