EmbeddedPkg/Ebl: eliminate deprecated string function calls

Get rid of calls to unsafe string functions. These are deprecated and may
be removed in the future.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
Ard Biesheuvel
2016-10-24 18:30:37 +01:00
parent 310908760f
commit 5140a6dfb9
5 changed files with 25 additions and 18 deletions

View File

@@ -343,7 +343,7 @@ EblStartCmd (
ImageInfo->LoadOptionsSize = (UINT32)AsciiStrSize (Argv[2]);
ImageInfo->LoadOptions = AllocatePool (ImageInfo->LoadOptionsSize);
AsciiStrCpy (ImageInfo->LoadOptions, Argv[2]);
AsciiStrCpyS (ImageInfo->LoadOptions, ImageInfo->LoadOptionsSize, Argv[2]);
}
// Transfer control to the EFI image we loaded with LoadImage()
@@ -741,7 +741,7 @@ EblFileCopyCmd (
UINTN Size;
UINTN Offset;
UINTN Chunk = FILE_COPY_CHUNK;
UINTN FileNameLen;
UINTN FileNameLen, DestFileNameLen;
CHAR8* DestFileName;
CHAR8* SrcFileName;
CHAR8* SrcPtr;
@@ -786,9 +786,10 @@ EblFileCopyCmd (
}
// Construct the destination filepath
DestFileName = (CHAR8*)AllocatePool (FileNameLen + AsciiStrLen (SrcFileName) + 1);
AsciiStrCpy (DestFileName, Argv[2]);
AsciiStrCat (DestFileName, SrcFileName);
DestFileNameLen = FileNameLen + AsciiStrLen (SrcFileName) + 1;
DestFileName = (CHAR8*)AllocatePool (DestFileNameLen);
AsciiStrCpyS (DestFileName, DestFileNameLen, Argv[2]);
AsciiStrCatS (DestFileName, DestFileNameLen, SrcFileName);
}
Source = EfiOpen(Argv[1], EFI_FILE_MODE_READ, 0);