EmbeddedPkg/AndroidFastboot: eliminate deprecated string function calls

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

Note that this also addresses a latent potential issue in HandleDownload(),
where NumBytesString[] (which comes from the wire) is assumed to contain a
string representation of a number with all the significant digits in the
first 8 bytes, which is not guaranteed by the protocol.

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:29:35 +01:00
parent 15d8747a5f
commit 310908760f
2 changed files with 8 additions and 6 deletions

View File

@@ -84,7 +84,8 @@ ParseAndroidBootImg (
+ ALIGN_VALUE (Header->KernelSize, Header->PageSize));
}
AsciiStrnCpy (KernelArgs, Header->KernelArgs, BOOTIMG_KERNEL_ARGS_SIZE);
AsciiStrnCpyS (KernelArgs, BOOTIMG_KERNEL_ARGS_SIZE, Header->KernelArgs,
BOOTIMG_KERNEL_ARGS_SIZE);
return EFI_SUCCESS;
}