summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpBootDxe/HttpBootDhcp4.h
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2016-11-16 13:37:15 +0800
committerFu Siyuan <siyuan.fu@intel.com>2016-11-18 16:30:50 +0800
commit632dcfd6857b6211ce3fe9755d3c11e74ef5d447 (patch)
tree03c5766d7efa36d127b45d5c716561115ee62dd6 /NetworkPkg/HttpBootDxe/HttpBootDhcp4.h
parent4f6b33b460226bc1a54d8af2c0f4fe195f2f04ce (diff)
downloadedk2-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/HttpBootDhcp4.h')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootDhcp4.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootDhcp4.h b/NetworkPkg/HttpBootDxe/HttpBootDhcp4.h
index 27d949850a..0b2cafbf50 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootDhcp4.h
+++ b/NetworkPkg/HttpBootDxe/HttpBootDhcp4.h
@@ -178,10 +178,12 @@ typedef struct {
UINT32 Reserved;
} HTTP_BOOT_VENDOR_OPTION;
+#define HTTP_CACHED_DHCP4_PACKET_MAX_SIZE (OFFSET_OF (EFI_DHCP4_PACKET, Dhcp4) + HTTP_BOOT_DHCP4_PACKET_MAX_SIZE)
+
typedef union {
EFI_DHCP4_PACKET Offer;
EFI_DHCP4_PACKET Ack;
- UINT8 Buffer[HTTP_BOOT_DHCP4_PACKET_MAX_SIZE];
+ UINT8 Buffer[HTTP_CACHED_DHCP4_PACKET_MAX_SIZE];
} HTTP_BOOT_DHCP4_PACKET;
typedef struct {