]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Check input Ptrs in GetSectionFromAnyFvByFileType
authorDandan Bi <dandan.bi@intel.com>
Mon, 19 Nov 2018 01:50:22 +0000 (09:50 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 21 Nov 2018 05:01:03 +0000 (13:01 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1337

In function GetSectionFromAnyFvByFileType, the input parameter "Buffer"
and "size" should not be NULL, so add ASSERT here to avoid any checker
report that the NULL pointer may be used.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/DxeServicesLib/DxeServicesLib.c

index d4f366425fed300127832c4386beded29e5ec533..e78d51cb923a642c468293b1f99e24302564ab63 100644 (file)
@@ -253,6 +253,9 @@ GetSectionFromAnyFvByFileType  (
   EFI_FV_FILE_ATTRIBUTES        Attributes;\r
   EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
 \r
+  ASSERT (Buffer != NULL);\r
+  ASSERT (Size != NULL);\r
+\r
   //\r
   // Locate all available FVs.\r
   //\r