]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c
MdeModulePkg: Fix IPv4 double free
[mirror_edk2.git] / MdeModulePkg / Universal / StatusCodeHandler / Smm / SerialStatusCodeWorker.c
index 868ffad7a3253f3276f3e1a9c181c5ab67addcbe..8f2fbf4f7a4219bd26b7b41fd4d73b4403f3e406 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Serial I/O status code reporting worker.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -46,7 +46,7 @@ SerialStatusCodeReportWorker (
   CHAR8           *Filename;\r
   CHAR8           *Description;\r
   CHAR8           *Format;\r
-  CHAR8           Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
+  CHAR8           Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
   UINT32          ErrorLevel;\r
   UINT32          LineNumber;\r
   UINTN           CharCount;\r
@@ -85,7 +85,7 @@ SerialStatusCodeReportWorker (
     CharCount = AsciiSPrint (\r
                   Buffer, \r
                   sizeof (Buffer), \r
-                  "ERROR: C%x:V%x I%x", \r
+                  "ERROR: C%08x:V%08x I%x", \r
                   CodeType, \r
                   Value, \r
                   Instance\r
@@ -94,7 +94,7 @@ SerialStatusCodeReportWorker (
    \r
     if (CallerId != NULL) {\r
       CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
+                     &Buffer[CharCount],\r
                      (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                      " %g",\r
                      CallerId\r
@@ -103,7 +103,7 @@ SerialStatusCodeReportWorker (
 \r
     if (Data != NULL) {\r
       CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
+                     &Buffer[CharCount],\r
                      (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                      " %x",\r
                      Data\r
@@ -111,7 +111,7 @@ SerialStatusCodeReportWorker (
     }\r
 \r
     CharCount += AsciiSPrint (\r
-                   &Buffer[CharCount - 1],\r
+                   &Buffer[CharCount],\r
                    (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                    "\n\r"\r
                    );\r
@@ -122,7 +122,7 @@ SerialStatusCodeReportWorker (
     CharCount = AsciiSPrint (\r
                   Buffer, \r
                   sizeof (Buffer), \r
-                  "PROGRESS CODE: V%x I%x\n\r", \r
+                  "PROGRESS CODE: V%08x I%x\n\r", \r
                   Value, \r
                   Instance\r
                   );\r
@@ -145,7 +145,7 @@ SerialStatusCodeReportWorker (
     CharCount = AsciiSPrint (\r
                   Buffer, \r
                   sizeof (Buffer), \r
-                  "Undefined: C%x:V%x I%x\n\r", \r
+                  "Undefined: C%08x:V%08x I%x\n\r", \r
                   CodeType, \r
                   Value, \r
                   Instance\r