[edk2] [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input parameter

Liming Gao posted 1 patch 6 years, 6 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Core/RuntimeDxe/Crc32.c | 4 ++++
1 file changed, 4 insertions(+)
[edk2] [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input parameter
Posted by Liming Gao 6 years, 6 months ago
This is the regression issue. After apply CalculateCrc32(), the parameter
check is missing.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Wu Hao A <hao.a.wu@intel.com>
---
 MdeModulePkg/Core/RuntimeDxe/Crc32.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/MdeModulePkg/Core/RuntimeDxe/Crc32.c b/MdeModulePkg/Core/RuntimeDxe/Crc32.c
index 3e91e08..c271856 100644
--- a/MdeModulePkg/Core/RuntimeDxe/Crc32.c
+++ b/MdeModulePkg/Core/RuntimeDxe/Crc32.c
@@ -42,6 +42,10 @@ RuntimeDriverCalculateCrc32 (
   OUT UINT32  *CrcOut
   )
 {
+  if (Data == NULL || DataSize == 0 || CrcOut == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
   *CrcOut = CalculateCrc32 (Data, DataSize);
   return EFI_SUCCESS;
 }
-- 
2.8.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input parameter
Posted by Wu, Hao A 6 years, 6 months ago
Reviewed-by: Hao Wu <hao.a.wu@intel.com>


Best Regards,
Hao Wu


> -----Original Message-----
> From: Gao, Liming
> Sent: Thursday, October 12, 2017 12:26 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A
> Subject: [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input
> parameter
> 
> This is the regression issue. After apply CalculateCrc32(), the parameter
> check is missing.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> Cc: Wu Hao A <hao.a.wu@intel.com>
> ---
>  MdeModulePkg/Core/RuntimeDxe/Crc32.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/MdeModulePkg/Core/RuntimeDxe/Crc32.c
> b/MdeModulePkg/Core/RuntimeDxe/Crc32.c
> index 3e91e08..c271856 100644
> --- a/MdeModulePkg/Core/RuntimeDxe/Crc32.c
> +++ b/MdeModulePkg/Core/RuntimeDxe/Crc32.c
> @@ -42,6 +42,10 @@ RuntimeDriverCalculateCrc32 (
>    OUT UINT32  *CrcOut
>    )
>  {
> +  if (Data == NULL || DataSize == 0 || CrcOut == NULL) {
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
>    *CrcOut = CalculateCrc32 (Data, DataSize);
>    return EFI_SUCCESS;
>  }
> --
> 2.8.0.windows.1

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