Reviewed-by: Shenglei Zhang <shenglei.zh...@intel.com> > -----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 <newexplor...@gmail.com> > Subject: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Suspicious check for > pointer Suite > > 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. > > Signed-off-by: GuoMinJ <newexplor...@gmail.com> > --- > UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 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")); > -- > 2.17.1 > > >
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55368): https://edk2.groups.io/g/devel/message/55368 Mute This Topic: https://groups.io/mt/71387157/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-