summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Core/RuntimeDxe/Crc32.c4
1 files changed, 4 insertions, 0 deletions
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;
}