From: Hao Wu Date: Tue, 30 Jun 2015 06:30:20 +0000 (+0000) Subject: IntelFspPkg BaseFspDebugLibSerialPort: Use safe string functions X-Git-Tag: edk2-stable201903~9530 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=c42b399a086638db9f5f2f0af0520fd5e6be5855 IntelFspPkg BaseFspDebugLibSerialPort: Use safe string functions Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Jiewen Yao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17743 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/IntelFspPkg/Library/BaseFspDebugLibSerialPort/DebugLib.c b/IntelFspPkg/Library/BaseFspDebugLibSerialPort/DebugLib.c index 8d90a1a598..73bb08e357 100644 --- a/IntelFspPkg/Library/BaseFspDebugLibSerialPort/DebugLib.c +++ b/IntelFspPkg/Library/BaseFspDebugLibSerialPort/DebugLib.c @@ -148,7 +148,12 @@ DebugAssertInternal ( // // Generate the ASSERT() message in Ascii format // - AsciiStrnCpy (Buffer, "-> EBP:0x00000000 EIP:0x00000000\n", sizeof(Buffer)); + AsciiStrnCpyS ( + Buffer, + sizeof(Buffer) / sizeof(CHAR8), + "-> EBP:0x00000000 EIP:0x00000000\n", + sizeof(Buffer) / sizeof(CHAR8) - 1 + ); SerialPortWrite ((UINT8 *)"ASSERT DUMP:\n", 13); while (Frame != NULL) { FillHex ((UINT32)Frame, Buffer + 9);