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@16002 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -228,13 +228,12 @@ MappingListHasType(
|
||||
// specific has priority
|
||||
//
|
||||
if (Specific != NULL) {
|
||||
NewSpecific = AllocateZeroPool(StrSize(Specific) + sizeof(CHAR16));
|
||||
NewSpecific = AllocateCopyPool(StrSize(Specific) + sizeof(CHAR16), Specific);
|
||||
if (NewSpecific == NULL){
|
||||
return FALSE;
|
||||
}
|
||||
StrCpy(NewSpecific, Specific);
|
||||
if (NewSpecific[StrLen(NewSpecific)-1] != L':') {
|
||||
StrCat(NewSpecific, L":");
|
||||
StrnCat(NewSpecific, L":", 2);
|
||||
}
|
||||
|
||||
if (SearchList(MapList, NewSpecific, NULL, TRUE, FALSE, L";")) {
|
||||
@ -877,13 +876,12 @@ AddMappingFromMapping(
|
||||
EFI_STATUS Status;
|
||||
CHAR16 *NewSName;
|
||||
|
||||
NewSName = AllocateZeroPool(StrSize(SName) + sizeof(CHAR16));
|
||||
NewSName = AllocateCopyPool(StrSize(SName) + sizeof(CHAR16), SName);
|
||||
if (NewSName == NULL) {
|
||||
return (SHELL_OUT_OF_RESOURCES);
|
||||
}
|
||||
StrCpy(NewSName, SName);
|
||||
if (NewSName[StrLen(NewSName)-1] != L':') {
|
||||
StrCat(NewSName, L":");
|
||||
StrnCat(NewSName, L":", 2);
|
||||
}
|
||||
|
||||
if (!IsNumberLetterOnly(NewSName, StrLen(NewSName)-1)) {
|
||||
@ -930,13 +928,12 @@ AddMappingFromHandle(
|
||||
EFI_STATUS Status;
|
||||
CHAR16 *NewSName;
|
||||
|
||||
NewSName = AllocateZeroPool(StrSize(SName) + sizeof(CHAR16));
|
||||
NewSName = AllocateCopyPool(StrSize(SName) + sizeof(CHAR16), SName);
|
||||
if (NewSName == NULL) {
|
||||
return (SHELL_OUT_OF_RESOURCES);
|
||||
}
|
||||
StrCpy(NewSName, SName);
|
||||
if (NewSName[StrLen(NewSName)-1] != L':') {
|
||||
StrCat(NewSName, L":");
|
||||
StrnCat(NewSName, L":", 2);
|
||||
}
|
||||
|
||||
if (!IsNumberLetterOnly(NewSName, StrLen(NewSName)-1)) {
|
||||
|
Reference in New Issue
Block a user