diff options
author | Marvin Haeuser <mhaeuser@outlook.de> | 2019-10-21 01:28:14 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-11-04 08:52:04 +0800 |
commit | 787c4baace1c0c49fa1628990402be8997294d17 (patch) | |
tree | dabc606cceb736f47b4675e0e2bd422d2ee5b259 /MdePkg | |
parent | 5ae6c993ab75c694831547b7436543a41d60458a (diff) | |
download | edk2-787c4baace1c0c49fa1628990402be8997294d17.zip edk2-787c4baace1c0c49fa1628990402be8997294d17.tar.gz edk2-787c4baace1c0c49fa1628990402be8997294d17.tar.bz2 |
MdePkg/UefiDebugLibStdErr: 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')
-rw-r--r-- | MdePkg/Library/UefiDebugLibStdErr/DebugLib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c index 40eb697..fcfdafe 100644 --- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c +++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c @@ -106,9 +106,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);
}
//
|