[edk2] [PATCH] MdeModulePkg DxeCapsuleLibFmp: Fix wrong Index is used

Star Zeng posted 1 patch 6 years ago
Failed in applying to current master (apply log)
MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2] [PATCH] MdeModulePkg DxeCapsuleLibFmp: Fix wrong Index is used
Posted by Star Zeng 6 years ago
DEBUG((
  DEBUG_ERROR,
  "ItemOffsetList[%d](0x%lx) < ItemOffsetList[%d](0x%x)\n",
  Index,
  ItemOffsetList[Index],
  Index,                       // Should be Index - 1
  ItemOffsetList[Index - 1]
  ));

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
index 36e8c26aa976..a5dcb76d5aaa 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
@@ -250,7 +250,7 @@ ValidateFmpCapsule (
     //
     if (Index > 0) {
       if (ItemOffsetList[Index] <= ItemOffsetList[Index - 1]) {
-        DEBUG((DEBUG_ERROR, "ItemOffsetList[%d](0x%lx) < ItemOffsetList[%d](0x%x)\n", Index, ItemOffsetList[Index], Index, ItemOffsetList[Index - 1]));
+        DEBUG((DEBUG_ERROR, "ItemOffsetList[%d](0x%lx) < ItemOffsetList[%d](0x%x)\n", Index, ItemOffsetList[Index], Index - 1, ItemOffsetList[Index - 1]));
         return EFI_INVALID_PARAMETER;
       }
     }
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] MdeModulePkg DxeCapsuleLibFmp: Fix wrong Index is used
Posted by Yao, Jiewen 6 years ago
Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Star
> Zeng
> Sent: Monday, April 16, 2018 4:42 PM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] [PATCH] MdeModulePkg DxeCapsuleLibFmp: Fix wrong Index is
> used
> 
> DEBUG((
>   DEBUG_ERROR,
>   "ItemOffsetList[%d](0x%lx) < ItemOffsetList[%d](0x%x)\n",
>   Index,
>   ItemOffsetList[Index],
>   Index,                       // Should be Index - 1
>   ItemOffsetList[Index - 1]
>   ));
> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
>  MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
> b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
> index 36e8c26aa976..a5dcb76d5aaa 100644
> --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
> +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
> @@ -250,7 +250,7 @@ ValidateFmpCapsule (
>      //
>      if (Index > 0) {
>        if (ItemOffsetList[Index] <= ItemOffsetList[Index - 1]) {
> -        DEBUG((DEBUG_ERROR, "ItemOffsetList[%d](0x%lx) <
> ItemOffsetList[%d](0x%x)\n", Index, ItemOffsetList[Index], Index,
> ItemOffsetList[Index - 1]));
> +        DEBUG((DEBUG_ERROR, "ItemOffsetList[%d](0x%lx) <
> ItemOffsetList[%d](0x%x)\n", Index, ItemOffsetList[Index], Index - 1,
> ItemOffsetList[Index - 1]));
>          return EFI_INVALID_PARAMETER;
>        }
>      }
> --
> 2.7.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel