From nobody Sun Apr 28 14:40:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56724+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56724+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1585637384; cv=none; d=zohomail.com; s=zohoarc; b=Ca3t4Lp3NLsBlSZBubtIIFtm39n02RdFABD2rPKLMFO0qtMaA/CEMORIq2aTNuankvCE/fKsgIk6eY9k5ElL5BI8l0BKdCMTLbMWJlrVjNLH6mgjyWuB9NZPwNBmrUEOQ7bOEqtEatbcqC+9tJnAes0+I/Yrn51QMv7IRZQmd80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585637384; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=28XLcOo6vghfI0HJGO8ZERl9AH3qZSHIpxlliABPQ+0=; b=belHUOuW8EkD1iaAH2aU249I/q/TLsbdZaRU0qzbLq/dbzrmEg0yqivlGZEt0TQMDH9nB6ff0uinwp+BupvnRqXw7NYA+gPzGaQuNdKevvj1RD9rV7TQjuljIjS8MD8YX6MXfPWd8NadBqHHGe2G3rlP5JgDXbxUYmHxvPlj3Co= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56724+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585637384748316.70657081127206; Mon, 30 Mar 2020 23:49:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id h9q1YY1788612xQk7XTo2Bsu; Mon, 30 Mar 2020 23:49:44 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.4170.1585637383448383815 for ; Mon, 30 Mar 2020 23:49:43 -0700 IronPort-SDR: EQKyAQVOEZ2o8C+crTwUVd4M2o9TDuz5ikK4h6kWUsie3CkFDPWS39emeMOzg6gd3J4479VTzN GArkuuYHIwpA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 23:49:42 -0700 IronPort-SDR: 8Z+sMWFeO7Xs1jA6sKeFds1Unxw8Ov5htxMGKaRJ92WOqfxd/T+qNXfL0qWjoR3vcqqPNoMGot mqSEoupUnxsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="252135643" X-Received: from guominji-mobl.ccr.corp.intel.com ([10.238.5.173]) by orsmga006.jf.intel.com with ESMTP; 30 Mar 2020 23:49:41 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Michael D Kinney , Sean Brogan , Bret Barkelew Subject: [edk2-devel] [PATCH] UnitTestFrameworkPkg/UnitTestLib: Correct dereferred pointer. Date: Tue, 31 Mar 2020 14:49:40 +0800 Message-Id: <20200331064940.1739-1-guomin.jiang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,guomin.jiang@intel.com X-Gm-Message-State: 4P5zdCNQxJHa0FGzOGzY0sBLx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1585637384; bh=5vKRe+uks+XLnbQwj0DCTBjl1vQDOTD+NzppHn79Eww=; h=Cc:Date:From:Reply-To:Subject:To; b=TTimO1svlZwBVtXuWCp+s4oWuhKtZGWQ2uqmQw+Rm2qaTHjj6ro5Iy94ESQ2UyP8GS0 okaXQ62jQ8H6xnXMq591SpnUS3pxav3u0ny7FbBCXu3Mb0c+12+dz+4Ne7TJD1JXrndFD SVB0oM0isEGvGcfpkGDLYue+FcSNanAQK8s= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2609 The copied pointer (SavedState) will be updated by LoadUnitTestCache call. But the change of SavedState will not update source pointer, which is NewFramework->SavedState in this case. Cc: Michael D Kinney Cc: Sean Brogan Cc: Bret Barkelew Signed-off-by: Guomin Jiang --- UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c b/UnitT= estFrameworkPkg/Library/UnitTestLib/UnitTestLib.c index b136992d99..71050b5618 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c @@ -209,7 +209,7 @@ InitUnitTestFramework ( EFI_STATUS Status; UNIT_TEST_FRAMEWORK_HANDLE NewFrameworkHandle; UNIT_TEST_FRAMEWORK *NewFramework; - UNIT_TEST_SAVE_HEADER *SavedState; + UNIT_TEST_SAVE_HEADER **SavedState; =20 Status =3D EFI_SUCCESS; NewFramework =3D NULL; @@ -264,8 +264,8 @@ InitUnitTestFramework ( // If there is a persisted context, load it now. // if (DoesCacheExist (NewFrameworkHandle)) { - SavedState =3D (UNIT_TEST_SAVE_HEADER *)NewFramework->SavedState; - Status =3D LoadUnitTestCache (NewFrameworkHandle, &SavedState); + SavedState =3D (UNIT_TEST_SAVE_HEADER **)(&NewFramework->SavedState); + Status =3D LoadUnitTestCache (NewFrameworkHandle, SavedState); if (EFI_ERROR (Status)) { // // Don't actually report it as an error, but emit a warning. --=20 2.25.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56724): https://edk2.groups.io/g/devel/message/56724 Mute This Topic: https://groups.io/mt/72671870/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-