]> 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 e49e1e44f9fb5f728018ac4df7a8309f37ee48a0..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
@@ -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