]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IScsiDxe/ComponentName.c
NetworkPkg/IScsiDxe: Enhance the check for array boundary
[mirror_edk2.git] / NetworkPkg / IScsiDxe / ComponentName.c
index 46d89d855ca38bb5b53017a2e682bf3fa78d10d2..8572ac281d1d300f3dcdc6d75bf4e5b49e20105c 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   UEFI Component Name(2) protocol implementation for iSCSI.\r
 \r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -106,11 +100,11 @@ IScsiComponentNameGetDriverName (
 \r
   @param[in]  IScsiExtScsiPassThru  A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
   @param[in]  Ipv6Flag              TRUE if IP6 network stack is used.\r
-  \r
+\r
   @retval EFI_SUCCESS               Update the ControllerNameTable of this instance successfully.\r
   @retval EFI_INVALID_PARAMETER     The input parameter is invalid.\r
   @retval EFI_UNSUPPORTED           Can't get the corresponding NIC info from the Controller handle.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 UpdateName (\r
@@ -126,10 +120,10 @@ UpdateName (
   if (IScsiExtScsiPassThru == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   Private  = ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU (IScsiExtScsiPassThru);\r
   NicIndex = Private->Session->ConfigData->NicIndex;\r
-    \r
+\r
   UnicodeSPrint (\r
     HandleName,\r
     sizeof (HandleName),\r
@@ -242,20 +236,20 @@ IScsiComponentNameGetControllerName (
   )\r
 {\r
   EFI_STATUS                      Status;\r
-  \r
+\r
   EFI_HANDLE                      IScsiController;\r
   BOOLEAN                         Ipv6Flag;\r
   EFI_GUID                        *IScsiPrivateGuid;\r
   ISCSI_PRIVATE_PROTOCOL          *IScsiIdentifier;\r
-  \r
+\r
   EFI_EXT_SCSI_PASS_THRU_PROTOCOL *IScsiExtScsiPassThru;\r
-  \r
+\r
   if (ControllerHandle == NULL) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
   //\r
-  // Get the handle of the controller we are controling.\r
+  // Get the handle of the controller we are controlling.\r
   //\r
   IScsiController = NetLibGetNicHandle (ControllerHandle, &gEfiTcp4ProtocolGuid);\r
   if (IScsiController != NULL) {\r
@@ -309,7 +303,7 @@ IScsiComponentNameGetControllerName (
         return Status;\r
       }\r
     }\r
-    \r
+\r
     //\r
     // Retrieve an instance of a produced protocol from ChildHandle\r
     //\r
@@ -324,7 +318,7 @@ IScsiComponentNameGetControllerName (
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
-    \r
+\r
     //\r
     // Update the component name for this child handle.\r
     //\r