From: Michael D Kinney Date: Tue, 20 Mar 2018 02:56:35 +0000 (-0700) Subject: MdeModulePkg/CapsuleApp: Fix logic bug in CleanGatherList() X-Git-Tag: edk2-stable201903~2056 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=845f7cfef2d61f31adc4fbd94bf51ce459785e6b;hp=2f1b849dc82f01ba5df198715f52dd6a0a8051c0 MdeModulePkg/CapsuleApp: Fix logic bug in CleanGatherList() 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 Reviewed-by: Jiewen Yao --- 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; }