/** @file\r
Udp6 driver's whole implementation.\r
\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, 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
Udp6Header = (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL);\r
ASSERT (Udp6Header != NULL);\r
+ if (Udp6Header == NULL) {\r
+ NetbufFree (Packet);\r
+ return;\r
+ }\r
\r
if (Udp6Header->Checksum != 0) {\r
//\r
//\r
Ip6ModeData = AllocateZeroPool (sizeof (EFI_IP6_MODE_DATA));\r
ASSERT (Ip6ModeData != NULL);\r
+ if (Ip6ModeData == NULL) {\r
+ goto EXIT;\r
+ }\r
\r
//\r
// If not finding the related IpSender use the default IpIo to send out\r
//\r
IcmpErrHdr = (IP6_ICMP_ERROR_HEAD *) NetbufAllocSpace (Packet, Len, FALSE);\r
ASSERT (IcmpErrHdr != NULL);\r
+ if (IcmpErrHdr == NULL) {\r
+ goto EXIT;\r
+ }\r
\r
//\r
// Set the required fields for the icmp port unreachable message.\r
\r
Udp6Header = (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL);\r
ASSERT (Udp6Header != NULL);\r
+ if (Udp6Header == NULL) {\r
+ NetbufFree (Packet);\r
+ return;\r
+ }\r
\r
IP6_COPY_ADDRESS (&Udp6Session.SourceAddress, &NetSession->Source);\r
IP6_COPY_ADDRESS (&Udp6Session.DestinationAddress, &NetSession->Dest);\r