]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/UefiDebugLibConOut: Pass the correct buffer size
authorMarvin Haeuser <mhaeuser@outlook.de>
Sun, 20 Oct 2019 12:08:35 +0000 (20:08 +0800)
committerLiming Gao <liming.gao@intel.com>
Mon, 4 Nov 2019 00:52:01 +0000 (08:52 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2302

The second argument of "UnicodeVSPrintAsciiFormat" is "BufferSize",
which takes the size of the buffer in bytes. Replace the currently
used MAX_DEBUG_MESSAGE_LENGTH usage, which is the buffer's length,
with the actual buffer size.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/UefiDebugLibConOut/DebugLib.c

index cf168d05cf21d18d0a687948a68a3192de105642..8ea38ea7cc7c9cb7ad20747d0a721e6fd409b235 100644 (file)
@@ -104,9 +104,9 @@ DebugPrintMarker (
     // Convert the DEBUG() message to a Unicode String\r
     //\r
     if (BaseListMarker == NULL) {\r
-      UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH,  Format, VaListMarker);\r
+      UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, VaListMarker);\r
     } else {\r
-      UnicodeBSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH,  Format, BaseListMarker);\r
+      UnicodeBSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, BaseListMarker);\r
     }\r
 \r
 \r