EmbeddedPkg/MmcDxe: 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 fixes an existing issue in the code, where the buffer may be overrun by one character when en == mLogRemainChar, in which case the NUL terminator ends up after the end of the buffer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
@ -42,9 +42,9 @@ DiagnosticLog (
|
||||
)
|
||||
{
|
||||
UINTN len = StrLen (Str);
|
||||
if (len <= mLogRemainChar) {
|
||||
if (len < mLogRemainChar) {
|
||||
StrCpyS (mLogBuffer, mLogRemainChar, Str);
|
||||
mLogRemainChar -= len;
|
||||
StrCpy (mLogBuffer, Str);
|
||||
mLogBuffer += len;
|
||||
return len;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user