From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.77.133]) by mx.groups.io with SMTP id smtpd.web12.1033.1585000442907560775 for ; Mon, 23 Mar 2020 14:54:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=h0eRclcj; spf=pass (domain: microsoft.com, ip: 40.107.77.133, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l5UKqe1yJKWhsdOzyoEhMxVq3FGC/3drTrdhPnfgzC7tGmXEJAkTwYAH5BzaJFubQmjwE4uGjMcEga+8RSAPPyLNOImJMrmmnGPbOxVbV2l9aZ2bA0dg/G7bCHH5OMuZfTqhAQsstbw8RyeiD97TFyMvXu25CAVJatILztrVc8ehj9FKr8xL20JciZCbM9Dp5tB/WW1QpFqq3yvKHtG9jWQ6769niM17NKW6Cm27ZYrSbed33f3xaLNofmygHJEtO6q4ZmZP3wpVmoc+TheUEwU2CjGFcBnRtUDHvgHVdoqUCJirfAdtxb1bhsRnuELm+aTrFoapBVqDqHk3y7w6PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UwMpRYa/2SxQJq2lLrXo98TS7lvazJNDXe55SNWZx/s=; b=mAhSuZFqU2el5GWmpKVzE2AkYlwo1QrdouNNWgwcd6vOsym4qBwP7tSRCA99oRFgoidI0PyCeIcnIDloS3k5xT9ugvYfowTcfwIPLVqL+1/5AquJMKZhiBrQ0qo+mtPgvd9FtDyzozoX8VUjZ3q7lGK5Wz/mhgLm3dJuKPEzjzQAMStzK4iLuEC9veRBWe3rx50toMNcY2YknC9gVkNcys+fEYu48g1CltrRz19Q0l3i6fjKsApY/oCRdafFm0JeHUHvzntSr8696ImtxUFb5nNtsKlTxnBRBNqY23JcI66IdMUbYjClJMRo8+uiPsq9j6tDBteskBSrSVQolzoJKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UwMpRYa/2SxQJq2lLrXo98TS7lvazJNDXe55SNWZx/s=; b=h0eRclcjRCGCgSDUinKVn/N/5KuvPtiIxBPJfWZJxpqD8Hg97WUR05O9BeowmyUQKt4ocNs66hnKm6U07sNyQK0GE9ubC6iN36xCc4aa75P8A40F3n75hSr8QDjjtwBvHUObdi+sUGarnExzvF+FT2xxqYzaeguRD3CUkl4jrnA= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0504.namprd21.prod.outlook.com (2603:10b6:903:dc::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.2; Mon, 23 Mar 2020 21:54:01 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318%10]) with mapi id 15.20.2878.000; Mon, 23 Mar 2020 21:54:01 +0000 From: "Bret Barkelew" To: "Kinney, Michael D" , "Jiang, Guomin" , "devel@edk2.groups.io" , "Zhang, Shenglei" , "newexplorerj@gmail.com" CC: Sean Brogan Subject: Re: [edk2-devel] [PATCH v2] UnitTestFrameworkPkg/UnitTestLib: Check Suite pointer before use. Thread-Topic: [edk2-devel] [PATCH v2] UnitTestFrameworkPkg/UnitTestLib: Check Suite pointer before use. Thread-Index: AQHV+DPTj/ohoedVdkOsEW2Yf+eiOahVwoeAgADHAACAAEEcZA== Date: Mon, 23 Mar 2020 21:54:01 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-03-23T21:53:43.7592623Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bret.Barkelew@microsoft.com; x-originating-ip: [71.212.145.195] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 7d3a4094-0970-4ccc-9c8a-08d7cf74b270 x-ms-traffictypediagnostic: CY4PR21MB0504:|CY4PR21MB0504:|CY4PR21MB0504: x-ms-exchange-transport-forked: True x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1923; x-forefront-prvs: 0351D213B3 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(376002)(396003)(366004)(136003)(39860400002)(346002)(7696005)(71200400001)(316002)(107886003)(2906002)(110136005)(86362001)(9686003)(55016002)(8936002)(81156014)(81166006)(8676002)(76116006)(66476007)(66556008)(64756008)(52536014)(478600001)(966005)(5660300002)(186003)(4326008)(53546011)(6506007)(66946007)(8990500004)(10290500003)(26005)(66446008)(33656002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0504;H:CY4PR21MB0743.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: z47R9lZhaHifA1pwOSF5G0WLj4L/1CcfQgDNaO97bVBcA4Zfhvy0morCIhqh1N3AuezfzULLKm7y0N4VyUEks/Kh9PAfCUBqoabwvslGMyJxSEjZge5K9cSBCdHZ7O7rpsfr3AOZY9YkDbevo3QsQY/XzE6QJRnOTNOkGKCIvmJbMmdXaKSBRDpv8lx7zmV7IqfyKyvWDGCSxIkKHXv3cXnRkA8mXg0guxP9qIiZsW4ZV+hzFiLwQfFbkQQTkT8MTOprSlQpFCFGV2n2PbWep7sO5qwVShayq66NyLu9FOlUYBzeFh73rryikyKwmJki/xWjpkeqikNNPNe4nR+jjsCy6dRv3B2otSLFomxZJ9+03xGw6z1fAoReTjehB07RY2Gig8gmzDUQLpZmywcArKUZNHYKtczPcm3Dq0QFzjAA7kXzbUQBrXtvyHPXoGGERQTa0SKUuaopGndEUTyaHguCLGPK82ED/eOCAE2drN/pSIrnMegSfUNyqVyi/a6JBwHj3j1qxc5eeILUADbOaA== x-ms-exchange-antispam-messagedata: q5dBaFjCoewsDS6S3mYCv2ziAJ9Jnos0qfncWReL6GmG/n/uCzyfSa+opjucylvj3C4JVZKlzei2H4PE7CUM/2PmnW3n8sToakcLTZ76GAgWWbNrLmtaoaObdMsfarcIV288cY3TP7EDUWNZ4/elqw== MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d3a4094-0970-4ccc-9c8a-08d7cf74b270 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Mar 2020 21:54:01.1995 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jvfKGksWRkRmWisylP5ZDe+8sF2AFBWlJKFsljdm+crFKDv+ub7QreAGSQkE5yRqi6BCz5GgWL/Av8W+Un1gUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0504 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB07435B6CD2939D5BCF1C6570EFF00CY4PR21MB0743namp_" --_000_CY4PR21MB07435B6CD2939D5BCF1C6570EFF00CY4PR21MB0743namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret ________________________________ From: Kinney, Michael D Sent: Monday, March 23, 2020 11:00:42 AM To: Jiang, Guomin ; devel@edk2.groups.io ; Zhang, Shenglei ; newexplorerj@gma= il.com ; Kinney, Michael D Cc: Sean Brogan ; Bret Barkelew Subject: [EXTERNAL] RE: [edk2-devel] [PATCH v2] UnitTestFrameworkPkg/UnitT= estLib: Check Suite pointer before use. Reviewed-by: Michael D Kinney Mike > -----Original Message----- > From: Jiang, Guomin > Sent: Sunday, March 22, 2020 11:08 PM > To: devel@edk2.groups.io; Zhang, Shenglei > ; newexplorerj@gmail.com > Cc: Kinney, Michael D ; > Sean Brogan ; Bret Barkelew > > Subject: RE: [edk2-devel] [PATCH v2] > UnitTestFrameworkPkg/UnitTestLib: Check Suite pointer > before use. > > Hi Michael, Sean, Bret, > > Could you review the patch? > > Thanks > > > -----Original Message----- > > From: devel@edk2.groups.io > [mailto:devel@edk2.groups.io] On Behalf Of > > Zhang, Shenglei > > Sent: Thursday, March 12, 2020 2:02 PM > > To: devel@edk2.groups.io; newexplorerj@gmail.com > > Cc: Kinney, Michael D ; > Sean Brogan > > ; Bret Barkelew > > > > Subject: Re: [edk2-devel] [PATCH v2] > UnitTestFrameworkPkg/UnitTestLib: > > Check Suite pointer before use. > > > > Reviewed-by: Shenglei Zhang > > > > > > -----Original Message----- > > > From: devel@edk2.groups.io > [mailto:devel@edk2.groups.io] On Behalf Of > > > GuoMinJ > > > Sent: Thursday, March 5, 2020 2:18 PM > > > To: devel@edk2.groups.io > > > Cc: GuoMinJ ; Kinney, > Michael D > > > ; Sean Brogan > > ; > > > Bret Barkelew > > > Subject: [edk2-devel] [PATCH v2] > UnitTestFrameworkPkg/UnitTestLib: > > > Check Suite pointer before use. > > > > > > REF: > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugz= illa.tianocore.org%2Fshow_bug.cgi%3Fid%3D2530&data=3D02%7C01%7CBret.Bar= kelew%40microsoft.com%7Cd0071fa41da24d2a4bd208d7cf541d73%7C72f988bf86f141af= 91ab2d7cd011db47%7C1%7C0%7C637205832511879282&sdata=3Dq0NPXM7RP90QhMdus= DZGd9nn1VtA4w%2FYxZbFu0vvnkI%3D&reserved=3D0 > > > > > > The Suite pointer is used before check if it is > valid, correct it to > > > check the validation before use. > > > > > > Cc: Michael D Kinney > > > Cc: Sean Brogan > > > Cc: Bret Barkelew > > > Signed-off-by: GuoMinJ > > > --- > > > > UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c > | 6 +++--- > > > > UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c > | 2 +- > > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > > > 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; > > > > > > - TestEntry =3D NULL; > > > - ParentFramework =3D (UNIT_TEST_FRAMEWORK *)Suite- > > >ParentFramework; > > > - > > > if (Suite =3D=3D NULL) { > > > return EFI_INVALID_PARAMETER; > > > } > > > > > > + 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")); > > > diff --git > a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib. > c > > > > b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib. > c > > > index fd15991ea4..b136992d99 100644 > > > --- > a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib. > c > > > +++ > b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib. > c > > > @@ -436,7 +436,6 @@ AddTestCase ( > > > > > > Status =3D EFI_SUCCESS; > > > Suite =3D (UNIT_TEST_SUITE > *)SuiteHandle; > > > - ParentFramework =3D (UNIT_TEST_FRAMEWORK *)Suite- > > >ParentFramework; > > > > > > // > > > // First, let's check to make sure that our > parameters look good. > > > @@ -445,6 +444,7 @@ AddTestCase ( > > > return EFI_INVALID_PARAMETER; > > > } > > > > > > + ParentFramework =3D (UNIT_TEST_FRAMEWORK *)Suite- > > > >ParentFramework; > > > // > > > // Create the new entry. > > > NewTestEntry =3D AllocateZeroPool (sizeof( > UNIT_TEST_LIST_ENTRY )); > > > -- > > > 2.17.1 > > > > > > > > > > > > > > >=20 --_000_CY4PR21MB07435B6CD2939D5BCF1C6570EFF00CY4PR21MB0743namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@micros= oft.com>

 

- Bret

 


From: Kinney, Michael D &l= t;michael.d.kinney@intel.com>
Sent: Monday, March 23, 2020 11:00:42 AM
To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups= .io <devel@edk2.groups.io>; Zhang, Shenglei <shenglei.zhang@intel.= com>; newexplorerj@gmail.com <newexplorerj@gmail.com>; Kinney, Mic= hael D <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew &l= t;Bret.Barkelew@microsoft.com>
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH v2] UnitTestFrameworkPk= g/UnitTestLib: Check Suite pointer before use.
 
Reviewed-by: Michael D Kinney <michael.d.kinne= y@intel.com>

Mike

> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Sunday, March 22, 2020 11:08 PM
> To: devel@edk2.groups.io; Zhang, Shenglei
> <shenglei.zhang@intel.com>; newexplorerj@gmail.com
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>;
> Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> <Bret.Barkelew@microsoft.com>
> Subject: RE: [edk2-devel] [PATCH v2]
> UnitTestFrameworkPkg/UnitTestLib: Check Suite pointer
> before use.
>
> Hi Michael, Sean, Bret,
>
> Could you review the patch?
>
> Thanks
>
> > -----Original Message-----
> > From: devel@edk2.groups.io
> [mailto:devel@edk2.groups.io<= /a>] On Behalf Of
> > Zhang, Shenglei
> > Sent: Thursday, March 12, 2020 2:02 PM
> > To: devel@edk2.groups.io; newexplorerj@gmail.com
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>;
> Sean Brogan
> > <sean.brogan@microsoft.com>; Bret Barkelew
> > <Bret.Barkelew@microsoft.com>
> > Subject: Re: [edk2-devel] [PATCH v2]
> UnitTestFrameworkPkg/UnitTestLib:
> > Check Suite pointer before use.
> >
> > Reviewed-by: Shenglei Zhang
> <shenglei.zhang@intel.com>
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io
> [
mailto:devel@edk2.groups.io<= /a>] On Behalf Of
> > > GuoMinJ
> > > Sent: Thursday, March 5, 2020 2:18 PM
> > > To: devel@edk2.groups.io
> > > Cc: GuoMinJ <newexplorerj@gmail.com>; Kinney,
> Michael D
> > > <michael.d.kinney@intel.com>; Sean Brogan
> > <sean.brogan@microsoft.com>;
> > > Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > Subject: [edk2-devel] [PATCH v2]
> UnitTestFrameworkPkg/UnitTestLib:
> > > Check Suite pointer before use.
> > >
> > > REF:
>
https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzil= la.tianocore.org%2Fshow_bug.cgi%3Fid%3D2530&amp;data=3D02%7C01%7CBret.B= arkelew%40microsoft.com%7Cd0071fa41da24d2a4bd208d7cf541d73%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637205832511879282&amp;sdata=3Dq0NPXM7RP90= QhMdusDZGd9nn1VtA4w%2FYxZbFu0vvnkI%3D&amp;reserved=3D0
> > >
> > > The Suite pointer is used before check if it is
> valid, correct it to
> > > check the validation before use.
> > >
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > > Signed-off-by: GuoMinJ <newexplorerj@gmail.com>
> > > ---
> > >
> UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c
> | 6 +++---
> > >
> UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
> | 2 +-
> > >  2 files changed, 4 insertions(+), 4 deletions(-)<= br> > > >
> > > 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     &n= bsp;       *Test;
> > >    UNIT_TEST_FRAMEWORK   *ParentFr= amework;
> > >
> > > -  TestEntry       =3D N= ULL;
> > > -  ParentFramework =3D (UNIT_TEST_FRAMEWORK *)Suite- > > >ParentFramework;
> > > -
> > >    if (Suite =3D=3D NULL) {
> > >      return EFI_INVALID_PARAMETER;=
> > >    }
> > >
> > > +  TestEntry       = =3D NULL;
> > > +  ParentFramework =3D (UNIT_TEST_FRAMEWORK *)Suit= e-
> > > >ParentFramework;
> > > +
> > >    DEBUG ((DEBUG_VERBOSE,
> > > "-------------------------------------------------- > ------
> > > -\n"));
> > >    DEBUG ((DEBUG_VERBOSE, "RUNNING TEST= SUITE:
> %a\n", Suite->Title));
> > >    DEBUG ((DEBUG_VERBOSE,
> > > "-------------------------------------------------- > ------
> > > -\n"));
> > > diff --git
> a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.
> c
> > >
> b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.
> c
> > > index fd15991ea4..b136992d99 100644
> > > ---
> a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.
> c
> > > +++
> b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.
> c
> > > @@ -436,7 +436,6 @@ AddTestCase (
> > >
> > >    Status      = ;    =3D EFI_SUCCESS;
> > >    Suite      =      =3D (UNIT_TEST_SUITE
> *)SuiteHandle;
> > > -  ParentFramework =3D (UNIT_TEST_FRAMEWORK *)Suite- > > >ParentFramework;
> > >
> > >    //
> > >    // First, let's check to make sure that o= ur
> parameters look good.
> > > @@ -445,6 +444,7 @@ AddTestCase (
> > >      return EFI_INVALID_PARAMETER;=
> > >    }
> > >
> > > +  ParentFramework =3D (UNIT_TEST_FRAMEWORK *)Suit= e-
> > > >ParentFramework;
> > >    //
> > >    // Create the new entry.
> > >    NewTestEntry =3D AllocateZeroPool (sizeof= (
> UNIT_TEST_LIST_ENTRY ));
> > > --
> > > 2.17.1
> > >
> > >
> > >
> >
> >
> >

--_000_CY4PR21MB07435B6CD2939D5BCF1C6570EFF00CY4PR21MB0743namp_--