]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/Library/BaseFspDebugLibSerialPort/DebugLib.c
IntelFspPkg BaseFspDebugLibSerialPort: Use safe string functions
[mirror_edk2.git] / IntelFspPkg / Library / BaseFspDebugLibSerialPort / DebugLib.c
index 8d90a1a598c3cc2720522a0285703fa370ab5ad8..73bb08e3574d67e9cc862b46318927ddbd389101 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