/** @file\r
Udp6 driver's whole implementation.\r
\r
- Copyright (c) 2009 - 2014, 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
);\r
\r
/**\r
- This function demultiplexes the received udp datagram to the apropriate instances.\r
+ This function demultiplexes the received udp datagram to the appropriate instances.\r
\r
@param[in] Udp6Service Pointer to the udp service context data.\r
- @param[in] NetSession Pointer to the EFI_NET_SESSION_DATA abstrated from\r
+ @param[in] NetSession Pointer to the EFI_NET_SESSION_DATA abstracted from\r
the received datagram.\r
@param[in] Packet Pointer to the buffer containing the received udp\r
datagram.\r
This function demultiplexes the received udp datagram to the appropriate instances.\r
\r
@param[in] Udp6Service Pointer to the udp service context data.\r
- @param[in] NetSession Pointer to the EFI_NET_SESSION_DATA abstrated from\r
+ @param[in] NetSession Pointer to the EFI_NET_SESSION_DATA abstracted from\r
the received datagram.\r
@param[in] Packet Pointer to the buffer containing the received udp\r
datagram.\r
EFI_UDP6_SESSION_DATA *Udp6Session;\r
UINTN Enqueued;\r
\r
+ if (Packet->TotalSize < sizeof (EFI_UDP_HEADER)) {\r
+ NetbufFree (Packet);\r
+ return;\r
+ }\r
+ \r
//\r
// Get the datagram header from the packet buffer.\r
//\r
//\r
// Wrong checksum.\r
//\r
+ NetbufFree (Packet);\r
return;\r
}\r
}\r
LIST_ENTRY *Entry;\r
UDP6_INSTANCE_DATA *Instance;\r
\r
+ if (Packet->TotalSize < sizeof (EFI_UDP_HEADER)) {\r
+ NetbufFree (Packet);\r
+ return;\r
+ }\r
+ \r
Udp6Header = (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL);\r
ASSERT (Udp6Header != NULL);\r
\r