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>
Reviewed-by: Wu Hao A <hao.a.wu@intel.com>
This commit is contained in:
Liming Gao 2017-10-12 12:22:57 +08:00
parent 79da2d2849
commit 3372ab3cf2
1 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,10 @@ RuntimeDriverCalculateCrc32 (
OUT UINT32 *CrcOut OUT UINT32 *CrcOut
) )
{ {
if (Data == NULL || DataSize == 0 || CrcOut == NULL) {
return EFI_INVALID_PARAMETER;
}
*CrcOut = CalculateCrc32 (Data, DataSize); *CrcOut = CalculateCrc32 (Data, DataSize);
return EFI_SUCCESS; return EFI_SUCCESS;
} }