mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
99ab5fc36c
commit
284065b0a1
|
@ -271,16 +271,16 @@ AppendOffsetWidthValue (
|
||||||
|
|
||||||
OriString = String;
|
OriString = String;
|
||||||
|
|
||||||
StrCpy (String, L"&OFFSET=");
|
StrnCpy (String, L"&OFFSET=", 9);
|
||||||
String += StrLen (L"&OFFSET=");
|
String += StrLen (L"&OFFSET=");
|
||||||
String += UnicodeSPrint (String, 20, L"%x", Offset);
|
String += UnicodeSPrint (String, 20, L"%x", Offset);
|
||||||
|
|
||||||
StrCpy (String,L"&WIDTH=");
|
StrnCpy (String,L"&WIDTH=", 8);
|
||||||
String += StrLen (L"&WIDTH=");
|
String += StrLen (L"&WIDTH=");
|
||||||
String += UnicodeSPrint (String, 20, L"%x", Width);
|
String += UnicodeSPrint (String, 20, L"%x", Width);
|
||||||
|
|
||||||
if (Block != NULL) {
|
if (Block != NULL) {
|
||||||
StrCpy (String,L"&VALUE=");
|
StrnCpy (String,L"&VALUE=", 8);
|
||||||
String += StrLen (L"&VALUE=");
|
String += StrLen (L"&VALUE=");
|
||||||
while ((Width--) != 0) {
|
while ((Width--) != 0) {
|
||||||
String += UnicodeSPrint (String, 20, L"%x", Block[Width]);
|
String += UnicodeSPrint (String, 20, L"%x", Block[Width]);
|
||||||
|
@ -369,7 +369,7 @@ ConstructConfigHdr (
|
||||||
}
|
}
|
||||||
|
|
||||||
String = ConfigHdr;
|
String = ConfigHdr;
|
||||||
StrCpy (String, L"GUID=");
|
StrnCpy (String, L"GUID=", 6);
|
||||||
String += StrLen (L"GUID=");
|
String += StrLen (L"GUID=");
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -382,7 +382,7 @@ ConstructConfigHdr (
|
||||||
//
|
//
|
||||||
// Append L"&NAME="
|
// Append L"&NAME="
|
||||||
//
|
//
|
||||||
StrCpy (String, L"&NAME=");
|
StrnCpy (String, L"&NAME=", 7);
|
||||||
String += StrLen (L"&NAME=");
|
String += StrLen (L"&NAME=");
|
||||||
for (Index = 0; Index < NameLength ; Index++) {
|
for (Index = 0; Index < NameLength ; Index++) {
|
||||||
String += UnicodeSPrint (String, 10, L"00%x", Name[Index]);
|
String += UnicodeSPrint (String, 10, L"00%x", Name[Index]);
|
||||||
|
@ -391,7 +391,7 @@ ConstructConfigHdr (
|
||||||
//
|
//
|
||||||
// Append L"&PATH="
|
// Append L"&PATH="
|
||||||
//
|
//
|
||||||
StrCpy (String, L"&PATH=");
|
StrnCpy (String, L"&PATH=", 7);
|
||||||
String += StrLen (L"&PATH=");
|
String += StrLen (L"&PATH=");
|
||||||
for (Index = 0, Buffer = (UINT8 *) DevicePath; Index < DevicePathLength; Index++) {
|
for (Index = 0, Buffer = (UINT8 *) DevicePath; Index < DevicePathLength; Index++) {
|
||||||
String += UnicodeSPrint (String, 6, L"%02x", *Buffer++);
|
String += UnicodeSPrint (String, 6, L"%02x", *Buffer++);
|
||||||
|
@ -618,7 +618,7 @@ IfconfigGetAllNicInfoByHii (
|
||||||
goto ON_ERROR;
|
goto ON_ERROR;
|
||||||
}
|
}
|
||||||
if (ConfigHdr != NULL) {
|
if (ConfigHdr != NULL) {
|
||||||
StrCpy (ConfigResp, ConfigHdr);
|
StrnCpy (ConfigResp, ConfigHdr, Length + NIC_ITEM_CONFIG_SIZE * 2 + 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -791,7 +791,7 @@ IfconfigSetNicAddrByHii (
|
||||||
goto ON_EXIT;
|
goto ON_EXIT;
|
||||||
}
|
}
|
||||||
if (ConfigHdr != NULL) {
|
if (ConfigHdr != NULL) {
|
||||||
StrCpy (ConfigResp, ConfigHdr);
|
StrnCpy (ConfigResp, ConfigHdr, Length + NIC_ITEM_CONFIG_SIZE * 2 + 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
NicConfig = AllocateZeroPool (NIC_ITEM_CONFIG_SIZE);
|
NicConfig = AllocateZeroPool (NIC_ITEM_CONFIG_SIZE);
|
||||||
|
|
Loading…
Reference in New Issue