]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
NetworkPkg: Check for the max DHCP packet length before use it.
[mirror_edk2.git] / NetworkPkg / HttpBootDxe / HttpBootDhcp6.c
index 847864203c8a3e4251ee723c09cac3fd2c3cdf5e..ca84f2ad9b8242c737f40c978e335d680eda15f6 100644 (file)
@@ -427,6 +427,12 @@ HttpBootDhcp6CallBack (
     \r
    case Dhcp6RcvdAdvertise:\r
      Status = EFI_NOT_READY;\r
+    if (Packet->Length > HTTP_BOOT_DHCP6_PACKET_MAX_SIZE) {\r
+      //\r
+      // Ignore the incoming packets which exceed the maximum length.\r
+      //\r
+      break;\r
+    }\r
      if (Private->OfferNum < HTTP_BOOT_OFFER_MAX_NUM) {\r
        //\r
        // Cache the dhcp offers to OfferBuffer[] for select later, and record\r