]> 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 e1f14a69681d0ec19cf9c6f50c477a1b6541e53f..11b8978b400581dc6add2a2ff943e4eb99d81e8d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Function to validate, parse, process the DHCP options.\r
   \r
-Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -389,7 +389,7 @@ DhcpIterateBufferOptions (
 EFI_STATUS\r
 DhcpIterateOptions (\r
   IN  EFI_DHCP4_PACKET      *Packet,\r
-  IN  DHCP_CHECK_OPTION     Check,        OPTIONAL\r
+  IN  DHCP_CHECK_OPTION     Check         OPTIONAL,\r
   IN  VOID                  *Context\r
   )\r
 {\r
@@ -668,8 +668,8 @@ DhcpValidateOptions (
   }\r
 \r
   AllOption = NULL;\r
-  Status    = DhcpParseOption (Packet, &Count, &AllOption);\r
 \r
+  Status = DhcpParseOption (Packet, &Count, &AllOption);\r
   if (EFI_ERROR (Status) || (Count == 0)) {\r
     return Status;\r
   }\r
@@ -679,6 +679,7 @@ DhcpValidateOptions (
 \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