]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Dhcp6Dxe/Dhcp6Io.c
NetworkPkg: Check received packet size before use it.
[mirror_edk2.git] / NetworkPkg / Dhcp6Dxe / Dhcp6Io.c
index b4e00079260a2924951b68717290805e3ac22f7b..d25b9734d8de7178c9ff6e648a1efeb0f86db32f 100644 (file)
@@ -2,7 +2,7 @@
   Dhcp6 internal functions implementation.\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2016 Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -2827,6 +2827,10 @@ Dhcp6ReceivePacket (
     return ;\r
   }\r
 \r
+  if (Udp6Wrap->TotalSize < sizeof (EFI_DHCP6_HEADER)) {\r
+    goto ON_CONTINUE;\r
+  }\r
+\r
   //\r
   // Copy the net buffer received from upd6 to a Dhcp6 packet.\r
   //\r