diff options
author | kuqin <kuqin@microsoft.com> | 2020-03-19 15:36:56 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-04-26 01:25:14 +0000 |
commit | c5c5c980dbaadf32193ac5e4ed2a35b665e0c76e (patch) | |
tree | 0cf1c3c83028583a9281ea0bec09c380f1866b10 | |
parent | 63d425002a7d513759be6f216e5bacb9157a5ded (diff) | |
download | edk2-c5c5c980dbaadf32193ac5e4ed2a35b665e0c76e.tar.gz edk2-c5c5c980dbaadf32193ac5e4ed2a35b665e0c76e.tar.bz2 edk2-c5c5c980dbaadf32193ac5e4ed2a35b665e0c76e.zip |
UnitTestFrameworkPkg/UnitTestLib: Correct dereferred pointer
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2609
SavedState is not sticky, copied pointer update will not change source
pointer
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: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
-rw-r--r-- | UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c index b136992d99..ba4b18568d 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c @@ -209,7 +209,6 @@ InitUnitTestFramework ( EFI_STATUS Status;
UNIT_TEST_FRAMEWORK_HANDLE NewFrameworkHandle;
UNIT_TEST_FRAMEWORK *NewFramework;
- UNIT_TEST_SAVE_HEADER *SavedState;
Status = EFI_SUCCESS;
NewFramework = NULL;
@@ -264,8 +263,7 @@ InitUnitTestFramework ( // If there is a persisted context, load it now.
//
if (DoesCacheExist (NewFrameworkHandle)) {
- SavedState = (UNIT_TEST_SAVE_HEADER *)NewFramework->SavedState;
- Status = LoadUnitTestCache (NewFrameworkHandle, &SavedState);
+ Status = LoadUnitTestCache (NewFrameworkHandle, (UNIT_TEST_SAVE_HEADER**)(&NewFramework->SavedState));
if (EFI_ERROR (Status)) {
//
// Don't actually report it as an error, but emit a warning.
|