summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/UefiDebugLibConOut
diff options
context:
space:
mode:
authorMarvin Haeuser <mhaeuser@outlook.de>2019-10-20 20:08:35 +0800
committerLiming Gao <liming.gao@intel.com>2019-11-04 08:52:01 +0800
commit5ae6c993ab75c694831547b7436543a41d60458a (patch)
tree0b5c3dc82186c42bf8d4fb8c0092737e626198cb /MdePkg/Library/UefiDebugLibConOut
parente2fc50812895b17e8b23f5a9c43cde29531b200f (diff)
downloadedk2-5ae6c993ab75c694831547b7436543a41d60458a.tar.gz
edk2-5ae6c993ab75c694831547b7436543a41d60458a.tar.bz2
edk2-5ae6c993ab75c694831547b7436543a41d60458a.zip
MdePkg/UefiDebugLibConOut: Pass the correct buffer size
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>
Diffstat (limited to 'MdePkg/Library/UefiDebugLibConOut')
-rw-r--r--MdePkg/Library/UefiDebugLibConOut/DebugLib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
index cf168d05cf..8ea38ea7cc 100644
--- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
+++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
@@ -104,9 +104,9 @@ DebugPrintMarker (
// Convert the DEBUG() message to a Unicode String
//
if (BaseListMarker == NULL) {
- UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, VaListMarker);
+ UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, VaListMarker);
} else {
- UnicodeBSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, BaseListMarker);
+ UnicodeBSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, BaseListMarker);
}