public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input parameter
@ 2017-10-12  4:25 Liming Gao
  2017-10-12  5:18 ` Wu, Hao A
  0 siblings, 1 reply; 2+ messages in thread
From: Liming Gao @ 2017-10-12  4:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: Wu Hao A

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-12  5:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-12  4:25 [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input parameter Liming Gao
2017-10-12  5:18 ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox