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 <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Michael D Kinney 2018-03-19 19:56:35 -07:00
parent 2f1b849dc8
commit 845f7cfef2
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
A shell application that triggers capsule update process. A shell application that triggers capsule update process.
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -653,7 +653,7 @@ CleanGatherList (
break; break;
} }
TempBlockPtr2 = (VOID *) ((UINTN) TempBlockPtr->Union.ContinuationPointer); TempBlockPtr2 = (VOID *) ((UINTN) TempBlockPtr[Index].Union.ContinuationPointer);
FreePool(TempBlockPtr1); FreePool(TempBlockPtr1);
TempBlockPtr1 = TempBlockPtr2; TempBlockPtr1 = TempBlockPtr2;
} }