diff options
author | Fu Siyuan <siyuan.fu@intel.com> | 2018-01-02 11:44:21 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2018-01-04 09:07:23 +0800 |
commit | 9f4f29cbeec4b7eaa822e5377a749d0721853e36 (patch) | |
tree | 6b83258e739a9c94878d076ba8efdaf28b56a488 /NetworkPkg/UefiPxeBcDxe | |
parent | 6a4eed9bad1c4fc08df5cf36eed0998417db43c3 (diff) | |
download | edk2-9f4f29cbeec4b7eaa822e5377a749d0721853e36.tar.gz edk2-9f4f29cbeec4b7eaa822e5377a749d0721853e36.tar.bz2 edk2-9f4f29cbeec4b7eaa822e5377a749d0721853e36.zip |
NetworkPkg: Check allocated buffer pointer before use.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg/UefiPxeBcDxe')
-rw-r--r-- | NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c index f2239fd8c0..327b4cf1cf 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c @@ -2,7 +2,7 @@ Functions implementation related with DHCPv6 for UefiPxeBc Driver.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -2030,6 +2030,9 @@ PxeBcDhcp6CallBack ( SelectAd = &Private->OfferBuffer[Private->SelectIndex - 1].Dhcp6.Packet.Offer;
*NewPacket = AllocateZeroPool (SelectAd->Size);
ASSERT (*NewPacket != NULL);
+ if (*NewPacket == NULL) {
+ return EFI_ABORTED;
+ }
CopyMem (*NewPacket, SelectAd, SelectAd->Size);
}
break;
|