summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaben Carsey <jaben.carsey@intel.com>2014-08-29 22:01:54 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2014-08-29 22:01:54 +0000
commit284065b0a190584412d78cf77dbd833170b3814a (patch)
tree4aacb5ecb32e9e2108ccb9fdbd3a4151c3ecaa24
parent99ab5fc36c544e0b6294bcf40dcada5d76ac2792 (diff)
downloadedk2-284065b0a190584412d78cf77dbd833170b3814a.zip
edk2-284065b0a190584412d78cf77dbd833170b3814a.tar.gz
edk2-284065b0a190584412d78cf77dbd833170b3814a.tar.bz2
This patch replaces StrCpy with StrnCpy or refactors out the usage of StrCpy through some other means.
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
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
index f837bab..9a85f91 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
@@ -271,16 +271,16 @@ AppendOffsetWidthValue (
OriString = String;
- StrCpy (String, L"&OFFSET=");
+ StrnCpy (String, L"&OFFSET=", 9);
String += StrLen (L"&OFFSET=");
String += UnicodeSPrint (String, 20, L"%x", Offset);
- StrCpy (String,L"&WIDTH=");
+ StrnCpy (String,L"&WIDTH=", 8);
String += StrLen (L"&WIDTH=");
String += UnicodeSPrint (String, 20, L"%x", Width);
if (Block != NULL) {
- StrCpy (String,L"&VALUE=");
+ StrnCpy (String,L"&VALUE=", 8);
String += StrLen (L"&VALUE=");
while ((Width--) != 0) {
String += UnicodeSPrint (String, 20, L"%x", Block[Width]);
@@ -369,7 +369,7 @@ ConstructConfigHdr (
}
String = ConfigHdr;
- StrCpy (String, L"GUID=");
+ StrnCpy (String, L"GUID=", 6);
String += StrLen (L"GUID=");
//
@@ -382,7 +382,7 @@ ConstructConfigHdr (
//
// Append L"&NAME="
//
- StrCpy (String, L"&NAME=");
+ StrnCpy (String, L"&NAME=", 7);
String += StrLen (L"&NAME=");
for (Index = 0; Index < NameLength ; Index++) {
String += UnicodeSPrint (String, 10, L"00%x", Name[Index]);
@@ -391,7 +391,7 @@ ConstructConfigHdr (
//
// Append L"&PATH="
//
- StrCpy (String, L"&PATH=");
+ StrnCpy (String, L"&PATH=", 7);
String += StrLen (L"&PATH=");
for (Index = 0, Buffer = (UINT8 *) DevicePath; Index < DevicePathLength; Index++) {
String += UnicodeSPrint (String, 6, L"%02x", *Buffer++);
@@ -618,7 +618,7 @@ IfconfigGetAllNicInfoByHii (
goto ON_ERROR;
}
if (ConfigHdr != NULL) {
- StrCpy (ConfigResp, ConfigHdr);
+ StrnCpy (ConfigResp, ConfigHdr, Length + NIC_ITEM_CONFIG_SIZE * 2 + 100);
}
//
@@ -791,7 +791,7 @@ IfconfigSetNicAddrByHii (
goto ON_EXIT;
}
if (ConfigHdr != NULL) {
- StrCpy (ConfigResp, ConfigHdr);
+ StrnCpy (ConfigResp, ConfigHdr, Length + NIC_ITEM_CONFIG_SIZE * 2 + 100);
}
NicConfig = AllocateZeroPool (NIC_ITEM_CONFIG_SIZE);