[edk2] [Patch 1/2] MdeModulePkg/CapsuleApp: Fix logic bug in CleanGatherList()

Michael D Kinney posted 2 patches 7 years, 10 months ago
[edk2] [Patch 1/2] MdeModulePkg/CapsuleApp: Fix logic bug in CleanGatherList()
Posted by Michael D Kinney 7 years, 10 months ago
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
---
 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.<BR>
+  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
   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

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch 1/2] MdeModulePkg/CapsuleApp: Fix logic bug in CleanGatherList()
Posted by Yao, Jiewen 7 years, 10 months ago
Reviewed-by: jiewen.yao@intel.com

> -----Original Message-----
> From: Kinney, Michael D
> Sent: Thursday, March 22, 2018 5:13 AM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Zeng, Star <star.zeng@intel.com>;
> Dong, Eric <eric.dong@intel.com>
> Subject: [Patch 1/2] 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
> ---
>  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.<BR>
> +  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
>    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

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel