From 3372ab3cf2ff73233947e6ae817cd474cdd9aeb3 Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Thu, 12 Oct 2017 12:22:57 +0800 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 Reviewed-by: Wu Hao A --- 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 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; } -- 2.39.2