From: Liming Gao Date: Thu, 12 Oct 2017 04:22:57 +0000 (+0800) Subject: MdeModulePkg: Update RuntimeDxe Crc32 to check the input parameter X-Git-Tag: edk2-stable201903~3220 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=3372ab3cf2ff73233947e6ae817cd474cdd9aeb3 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 Reviewed-by: Wu Hao A --- diff --git a/MdeModulePkg/Core/RuntimeDxe/Crc32.c b/MdeModulePkg/Core/RuntimeDxe/Crc32.c index 3e91e08049..c271856015 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; }