MdeModulePkg/CapsuleApp: Fix logic bug in CleanGatherList()
authorMichael D Kinney <michael.d.kinney@intel.com>
Tue, 20 Mar 2018 02:56:35 +0000 (19:56 -0700)
committerMichael D Kinney <michael.d.kinney@intel.com>
Thu, 22 Mar 2018 03:55:27 +0000 (20:55 -0700)
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>
MdeModulePkg/Application/CapsuleApp/CapsuleApp.c

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