diff options
author | Fu Siyuan <siyuan.fu@intel.com> | 2016-11-16 13:37:15 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2016-11-18 16:30:50 +0800 |
commit | 632dcfd6857b6211ce3fe9755d3c11e74ef5d447 (patch) | |
tree | 03c5766d7efa36d127b45d5c716561115ee62dd6 /NetworkPkg/HttpBootDxe/HttpBootDhcp6.c | |
parent | 4f6b33b460226bc1a54d8af2c0f4fe195f2f04ce (diff) | |
download | edk2-632dcfd6857b6211ce3fe9755d3c11e74ef5d447.tar.gz edk2-632dcfd6857b6211ce3fe9755d3c11e74ef5d447.tar.bz2 edk2-632dcfd6857b6211ce3fe9755d3c11e74ef5d447.zip |
NetworkPkg: Check for the max DHCP packet length before use it.
This patch updates the PXE and HTTP boot driver to drop the input DHCP packet
if it exceed the maximum length.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg/HttpBootDxe/HttpBootDhcp6.c')
-rw-r--r-- | NetworkPkg/HttpBootDxe/HttpBootDhcp6.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootDhcp6.c b/NetworkPkg/HttpBootDxe/HttpBootDhcp6.c index 847864203c..ca84f2ad9b 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootDhcp6.c +++ b/NetworkPkg/HttpBootDxe/HttpBootDhcp6.c @@ -427,6 +427,12 @@ HttpBootDhcp6CallBack ( case Dhcp6RcvdAdvertise:
Status = EFI_NOT_READY;
+ if (Packet->Length > HTTP_BOOT_DHCP6_PACKET_MAX_SIZE) {
+ //
+ // Ignore the incoming packets which exceed the maximum length.
+ //
+ break;
+ }
if (Private->OfferNum < HTTP_BOOT_OFFER_MAX_NUM) {
//
// Cache the dhcp offers to OfferBuffer[] for select later, and record
|