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>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user