diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-29 09:19:25 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-29 09:19:25 +0000 |
commit | 894d038a8d0e99d456042e2b6d1554c4a406ea70 (patch) | |
tree | cbce1adbcd8436ff3e73e693a0fae87ce5e7482b /MdeModulePkg/Universal/Network/Dhcp4Dxe | |
parent | f2a064736dcea55b602e0e74607cb9b5b9f4a730 (diff) | |
download | edk2-platforms-894d038a8d0e99d456042e2b6d1554c4a406ea70.tar.xz |
add security check.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8680 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Dhcp4Dxe')
-rw-r--r-- | MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c | 5 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c index f2c2100d36..6d82230457 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c @@ -1,7 +1,7 @@ /** @file
This file implement the EFI_DHCP4_PROTOCOL interface.
-Copyright (c) 2006 - 2008, Intel Corporation.<BR>
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1313,12 +1313,13 @@ PxeDhcpInput ( //
Len = NET_ROUNDUP (sizeof (EFI_DHCP4_PACKET) + UdpPacket->TotalSize - sizeof (EFI_DHCP4_HEADER), 4);
Wrap = NetbufAlloc (Len);
-
if (Wrap == NULL) {
goto RESTART;
}
Packet = (EFI_DHCP4_PACKET *) NetbufAllocSpace (Wrap, Len, NET_BUF_TAIL);
+ ASSERT (Packet != NULL);
+
Packet->Size = Len;
Head = &Packet->Dhcp4.Header;
Packet->Length = NetbufCopy (UdpPacket, 0, UdpPacket->TotalSize, (UINT8 *) Head);
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c index e49e1e44f9..11b8978b40 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c @@ -1,7 +1,7 @@ /** @file
Function to validate, parse, process the DHCP options.
-Copyright (c) 2006 - 2008, Intel Corporation.<BR>
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -668,8 +668,8 @@ DhcpValidateOptions ( }
AllOption = NULL;
- Status = DhcpParseOption (Packet, &Count, &AllOption);
+ Status = DhcpParseOption (Packet, &Count, &AllOption);
if (EFI_ERROR (Status) || (Count == 0)) {
return Status;
}
@@ -679,6 +679,7 @@ DhcpValidateOptions ( for (Index = 0; Index < Count; Index++) {
Option = &AllOption[Index];
+ ASSERT (Option != NULL);
//
// Find the format of the option then validate it.
|