Hi Michael, Sean, Bret,

Could you review the patch?

Thanks

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of
> Zhang, Shenglei
> Sent: Thursday, March 12, 2020 2:02 PM
> To: [email protected]; [email protected]
> Cc: Kinney, Michael D <[email protected]>; Sean Brogan
> <[email protected]>; Bret Barkelew
> <[email protected]>
> Subject: Re: [edk2-devel] [PATCH v2] UnitTestFrameworkPkg/UnitTestLib:
> Check Suite pointer before use.
> 
> Reviewed-by: Shenglei Zhang <[email protected]>
> 
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]] On Behalf Of
> > GuoMinJ
> > Sent: Thursday, March 5, 2020 2:18 PM
> > To: [email protected]
> > Cc: GuoMinJ <[email protected]>; Kinney, Michael D
> > <[email protected]>; Sean Brogan
> <[email protected]>;
> > Bret Barkelew <[email protected]>
> > Subject: [edk2-devel] [PATCH v2] UnitTestFrameworkPkg/UnitTestLib:
> > Check Suite pointer before use.
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2530
> >
> > The Suite pointer is used before check if it is valid, correct it to
> > check the validation before use.
> >
> > Cc: Michael D Kinney <[email protected]>
> > Cc: Sean Brogan <[email protected]>
> > Cc: Bret Barkelew <[email protected]>
> > Signed-off-by: GuoMinJ <[email protected]>
> > ---
> >  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       = NULL;
> > -  ParentFramework = (UNIT_TEST_FRAMEWORK *)Suite-
> >ParentFramework;
> > -
> >    if (Suite == NULL) {
> >      return EFI_INVALID_PARAMETER;
> >    }
> >
> > +  TestEntry       = NULL;
> > +  ParentFramework = (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          = EFI_SUCCESS;
> >    Suite           = (UNIT_TEST_SUITE *)SuiteHandle;
> > -  ParentFramework = (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 = (UNIT_TEST_FRAMEWORK *)Suite-
> > >ParentFramework;
> >    //
> >    // Create the new entry.
> >    NewTestEntry = AllocateZeroPool (sizeof( UNIT_TEST_LIST_ENTRY ));
> > --
> > 2.17.1
> >
> >
> >
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56091): https://edk2.groups.io/g/devel/message/56091
Mute This Topic: https://groups.io/mt/71744323/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to