]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Ip6Dxe/Ip6Common.c
MdePkg/SmmMemLib: Check for untested memory in GCD
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6Common.c
index 4f71d052bf85c16a2a2b4596cd92257dd1f1922b..c18918e7348205bb82a3b58172daa1f16eb4ae50 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation of common functions shared by IP6 driver.\r
 \r
-  Copyright (c) 2009 - 2014, 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
@@ -330,7 +330,7 @@ Ip6AddAddr (
 \r
 /**\r
   Callback function which provided by user to remove one node in NetDestroyLinkList process.\r
-  \r
+\r
   @param[in]    Entry           The entry to be removed.\r
   @param[in]    Context         Pointer to the callback context corresponds to the Context in NetDestroyLinkList.\r
 \r
@@ -348,7 +348,7 @@ Ip6DestroyChildEntryByAddr (
   IP6_PROTOCOL                  *Instance;\r
   EFI_SERVICE_BINDING_PROTOCOL  *ServiceBinding;\r
   EFI_IPv6_ADDRESS              *Address;\r
-  \r
+\r
   Instance = NET_LIST_USER_STRUCT_S (Entry, IP6_PROTOCOL, Link, IP6_PROTOCOL_SIGNATURE);\r
   ServiceBinding = ((IP6_DESTROY_CHILD_BY_ADDR_CALLBACK_CONTEXT*) Context)->ServiceBinding;\r
   Address = ((IP6_DESTROY_CHILD_BY_ADDR_CALLBACK_CONTEXT*) Context)->Address;\r
@@ -356,7 +356,7 @@ Ip6DestroyChildEntryByAddr (
   if ((Instance->State == IP6_STATE_CONFIGED) && EFI_IP6_EQUAL (&Instance->ConfigData.StationAddress, Address)) {\r
     return ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -428,7 +428,7 @@ Ip6RemoveAddr (
   IP6_ADDRESS_INFO     *AddrInfo;\r
   EFI_IPv6_ADDRESS     SnMCastAddr;\r
 \r
-  if (IsListEmpty (AddressList) || *AddressCount < 1 || PrefixLength > IP6_PREFIX_NUM) {\r
+  if (IsListEmpty (AddressList) || *AddressCount < 1 || PrefixLength > IP6_PREFIX_MAX) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -606,7 +606,7 @@ Ip6CopyAddressByPrefix (
   UINT8 Mask;\r
 \r
   ASSERT (Dest != NULL && Src != NULL);\r
-  ASSERT (PrefixLength < IP6_PREFIX_NUM);\r
+  ASSERT (PrefixLength <= IP6_PREFIX_MAX);\r
 \r
   Byte = (UINT8) (PrefixLength / 8);\r
   Bit  = (UINT8) (PrefixLength % 8);\r