From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D7BF9223DB11E for ; Wed, 21 Mar 2018 14:06:57 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2018 14:13:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,341,1517904000"; d="scan'208";a="213473651" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.241.98.49]) by fmsmga006.fm.intel.com with ESMTP; 21 Mar 2018 14:13:28 -0700 From: Michael D Kinney To: edk2-devel@lists.01.org Cc: Jiewen Yao , Star Zeng , Eric Dong Date: Wed, 21 Mar 2018 14:13:24 -0700 Message-Id: <20180321211325.16388-2-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180321211325.16388-1-michael.d.kinney@intel.com> References: <20180321211325.16388-1-michael.d.kinney@intel.com> Subject: [Patch 1/2] MdeModulePkg/CapsuleApp: Fix logic bug in CleanGatherList() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2018 21:06:58 -0000 https://bugzilla.tianocore.org/show_bug.cgi?id=905 Fix pointer math when more than one capsule is passed to the CapsuleApp. Use the ContinuationPointer from the last array entry instead of the first array entry. Cc: Jiewen Yao Cc: Star Zeng Cc: Eric Dong Signed-off-by: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.1 --- MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c index 393cfe5060..b9ff812179 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c @@ -1,7 +1,7 @@ /** @file A shell application that triggers capsule update process. - Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -653,7 +653,7 @@ CleanGatherList ( break; } - TempBlockPtr2 = (VOID *) ((UINTN) TempBlockPtr->Union.ContinuationPointer); + TempBlockPtr2 = (VOID *) ((UINTN) TempBlockPtr[Index].Union.ContinuationPointer); FreePool(TempBlockPtr1); TempBlockPtr1 = TempBlockPtr2; } -- 2.14.2.windows.3