Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a...@intel.com>
Reviewed-by: Jiewen Yao <jiewen....@intel.com>
---
 IntelFspPkg/Library/BaseFspDebugLibSerialPort/DebugLib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/IntelFspPkg/Library/BaseFspDebugLibSerialPort/DebugLib.c 
b/IntelFspPkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
index 8d90a1a..73bb08e 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);
-- 
1.9.5.msysgit.0


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to