]> git.proxmox.com Git - mirror_edk2.git/commitdiff
This patch replaces StrCpy with StrnCpy or refactors out the usage of StrCpy through...
authorJaben Carsey <jaben.carsey@intel.com>
Fri, 29 Aug 2014 22:01:54 +0000 (22:01 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 29 Aug 2014 22:01:54 +0000 (22:01 +0000)
This patch replaces StrCat with StrnCat or refactors out the usage of StrCat through some other means.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16005 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c

index f837bab4544d4170c4304bec0703acf494d1b9b2..9a85f917bb8d7e2db134cef6c450f0dd59c12458 100644 (file)
@@ -271,16 +271,16 @@ AppendOffsetWidthValue (
 \r
   OriString = String;\r
 \r
-  StrCpy (String, L"&OFFSET=");\r
+  StrnCpy (String, L"&OFFSET=", 9);\r
   String += StrLen (L"&OFFSET=");\r
   String += UnicodeSPrint (String, 20, L"%x", Offset);\r
 \r
-  StrCpy (String,L"&WIDTH=");\r
+  StrnCpy (String,L"&WIDTH=", 8);\r
   String += StrLen (L"&WIDTH=");\r
   String += UnicodeSPrint (String, 20, L"%x", Width);\r
 \r
   if (Block != NULL) {\r
-    StrCpy (String,L"&VALUE=");\r
+    StrnCpy (String,L"&VALUE=", 8);\r
     String += StrLen (L"&VALUE=");\r
     while ((Width--) != 0) {\r
       String += UnicodeSPrint (String, 20, L"%x", Block[Width]);\r
@@ -369,7 +369,7 @@ ConstructConfigHdr (
   } \r
 \r
   String = ConfigHdr;\r
-  StrCpy (String, L"GUID=");\r
+  StrnCpy (String, L"GUID=", 6);\r
   String += StrLen (L"GUID=");\r
 \r
   //\r
@@ -382,7 +382,7 @@ ConstructConfigHdr (
   //\r
   // Append L"&NAME="\r
   //\r
-  StrCpy (String, L"&NAME=");\r
+  StrnCpy (String, L"&NAME=", 7);\r
   String += StrLen (L"&NAME=");\r
   for (Index = 0; Index < NameLength ; Index++) {\r
     String += UnicodeSPrint (String, 10, L"00%x", Name[Index]);\r
@@ -391,7 +391,7 @@ ConstructConfigHdr (
   //\r
   // Append L"&PATH="\r
   //\r
-  StrCpy (String, L"&PATH=");\r
+  StrnCpy (String, L"&PATH=", 7);\r
   String += StrLen (L"&PATH=");\r
   for (Index = 0, Buffer = (UINT8 *) DevicePath; Index < DevicePathLength; Index++) {\r
     String += UnicodeSPrint (String, 6, L"%02x", *Buffer++);\r
@@ -618,7 +618,7 @@ IfconfigGetAllNicInfoByHii (
       goto ON_ERROR;\r
     }\r
     if (ConfigHdr != NULL) {\r
-      StrCpy (ConfigResp, ConfigHdr);\r
+      StrnCpy (ConfigResp, ConfigHdr, Length + NIC_ITEM_CONFIG_SIZE * 2 + 100);\r
     }\r
  \r
     //\r
@@ -791,7 +791,7 @@ IfconfigSetNicAddrByHii (
     goto ON_EXIT;\r
   }\r
   if (ConfigHdr != NULL) {\r
-    StrCpy (ConfigResp, ConfigHdr);\r
+    StrnCpy (ConfigResp, ConfigHdr, Length + NIC_ITEM_CONFIG_SIZE * 2 + 100);\r
   }\r
 \r
   NicConfig = AllocateZeroPool (NIC_ITEM_CONFIG_SIZE);\r