]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
add security check.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Impl.c
index f2c2100d363ef236bc2aeb92af8d1c5fb23a7185..6d82230457d8f06b604dc215ea9d9de7fffafb3b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This file implement the EFI_DHCP4_PROTOCOL interface.\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
@@ -1313,12 +1313,13 @@ PxeDhcpInput (
   //\r
   Len  = NET_ROUNDUP (sizeof (EFI_DHCP4_PACKET) + UdpPacket->TotalSize - sizeof (EFI_DHCP4_HEADER), 4);\r
   Wrap = NetbufAlloc (Len);\r
-\r
   if (Wrap == NULL) {\r
     goto RESTART;\r
   }\r
 \r
   Packet         = (EFI_DHCP4_PACKET *) NetbufAllocSpace (Wrap, Len, NET_BUF_TAIL);\r
+  ASSERT (Packet != NULL);\r
+\r
   Packet->Size   = Len;\r
   Head           = &Packet->Dhcp4.Header;\r
   Packet->Length = NetbufCopy (UdpPacket, 0, UdpPacket->TotalSize, (UINT8 *) Head);\r