IntelFspPkg BaseFspDebugLibSerialPort: Use safe string functions
authorHao Wu <hao.a.wu@intel.com>
Tue, 30 Jun 2015 06:30:20 +0000 (06:30 +0000)
committerhwu1225 <hwu1225@Edk2>
Tue, 30 Jun 2015 06:30:20 +0000 (06:30 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17743 6f19259b-4bc3-4df7-8a09-765794883524

IntelFspPkg/Library/BaseFspDebugLibSerialPort/DebugLib.c

index 8d90a1a..73bb08e 100644 (file)
@@ -148,7 +148,12 @@ DebugAssertInternal (
   //\r
   // Generate the ASSERT() message in Ascii format\r
   //\r
-  AsciiStrnCpy (Buffer, "-> EBP:0x00000000  EIP:0x00000000\n", sizeof(Buffer));\r
+  AsciiStrnCpyS (\r
+    Buffer,\r
+    sizeof(Buffer) / sizeof(CHAR8),\r
+    "-> EBP:0x00000000  EIP:0x00000000\n",\r
+    sizeof(Buffer) / sizeof(CHAR8) - 1\r
+    );\r
   SerialPortWrite ((UINT8 *)"ASSERT DUMP:\n", 13);\r
   while (Frame != NULL) {\r
     FillHex ((UINT32)Frame, Buffer + 9);\r