From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.8432.1583308707946011933 for ; Tue, 03 Mar 2020 23:58:28 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: shenglei.zhang@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Mar 2020 23:58:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,513,1574150400"; d="scan'208";a="287268917" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 03 Mar 2020 23:58:26 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Mar 2020 23:58:26 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Mar 2020 23:58:25 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.206]) by shsmsx102.ccr.corp.intel.com ([169.254.2.50]) with mapi id 14.03.0439.000; Wed, 4 Mar 2020 15:58:23 +0800 From: "Zhang, Shenglei" To: "devel@edk2.groups.io" , "newexplorerj@gmail.com" Subject: Re: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Suspicious check for pointer Suite Thread-Topic: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Suspicious check for pointer Suite Thread-Index: AQHV5s2awAYFM6K9Fk2kTys+7SBbbKg4JyjA Date: Wed, 4 Mar 2020 07:58:23 +0000 Message-ID: References: <688166e8ec46f20a29ffedb8703ca7d94059b483.1582079674.git.newexplorerj@gmail.com> In-Reply-To: <688166e8ec46f20a29ffedb8703ca7d94059b483.1582079674.git.newexplorerj@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: shenglei.zhang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Shenglei Zhang > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > GuoMinJ > Sent: Wednesday, February 19, 2020 10:35 AM > To: devel@edk2.groups.io > Cc: GuoMinJ > Subject: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Suspicious check for > pointer Suite >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2530 >=20 > The Suite pointer is used before check if it is valid, > correct it to check the validation before use. >=20 > Signed-off-by: GuoMinJ > --- > UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c > b/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c > index fb247c59e7..b053e04959 100644 > --- a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c > +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c > @@ -33,13 +33,13 @@ RunTestSuite ( > UNIT_TEST *Test; > UNIT_TEST_FRAMEWORK *ParentFramework; >=20 > - TestEntry =3D NULL; > - ParentFramework =3D (UNIT_TEST_FRAMEWORK *)Suite->ParentFramework; > - > if (Suite =3D=3D NULL) { > return EFI_INVALID_PARAMETER; > } >=20 > + TestEntry =3D NULL; > + ParentFramework =3D (UNIT_TEST_FRAMEWORK *)Suite- > >ParentFramework; > + > DEBUG ((DEBUG_VERBOSE, "---------------------------------------------= ----------- > -\n")); > DEBUG ((DEBUG_VERBOSE, "RUNNING TEST SUITE: %a\n", Suite->Title)); > DEBUG ((DEBUG_VERBOSE, "---------------------------------------------= ----------- > -\n")); > -- > 2.17.1 >=20 >=20 >=20