]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c
add security check.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Option.c
index aa5009abf320512b5300d587161fc78528a0acc2..559fd9ad0eca24addf62fac3165693d5f670ba37 100644 (file)
@@ -542,6 +542,7 @@ DhcpFillOption (
   @param[out] OptionPoint            The array that contains the DHCP options. Caller\r
                                      should free it.\r
 \r
+  @retval EFI_NOT_FOUND          Cannot find any option.\r
   @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory to parse the packet.\r
   @retval EFI_INVALID_PARAMETER  The options are mal-formated\r
   @retval EFI_SUCCESS            The options are parsed into OptionPoint\r
@@ -603,6 +604,7 @@ DhcpParseOption (
   *OptionPoint  = NULL;\r
 \r
   if (OptNum == 0) {\r
+    Status = EFI_NOT_FOUND;\r
     goto ON_EXIT;\r
   }\r
 \r
@@ -673,13 +675,12 @@ DhcpValidateOptions (
   if (EFI_ERROR (Status) || (Count == 0)) {\r
     return Status;\r
   }\r
-\r
+  \r
   Updated = FALSE;\r
   ZeroMem (&Parameter, sizeof (Parameter));\r
 \r
   for (Index = 0; Index < Count; Index++) {\r
     Option = &AllOption[Index];\r
-    ASSERT (Option != NULL);\r
 \r
     //\r
     // Find the format of the option then validate it.\r