From: "Marvin Häuser" <Marvin.Haeuser@outlook.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "vit9696@protonmail.com" <vit9696@protonmail.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
Liming Gao <liming.gao@intel.com>
Subject: [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size
Date: Sun, 20 Oct 2019 17:28:14 +0000 [thread overview]
Message-ID: <DB7PR07MB4917B4F1813CF3CADA94F078806E0@DB7PR07MB4917.eurprd07.prod.outlook.com> (raw)
In-Reply-To: <aa5718fc4fdc610f03912cfcfd6fd8760d866117.1571592440.git.mhaeuser@outlook.de>
From: Marvin Haeuser <mhaeuser@outlook.de>
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>
---
MdePkg/Library/UefiDebugLibStdErr/DebugLib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
index 40eb697e7e2c..fcfdafede08f 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);
}
//
--
2.23.0.windows.1
next parent reply other threads:[~2019-10-20 17:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <aa5718fc4fdc610f03912cfcfd6fd8760d866117.1571592440.git.mhaeuser@outlook.de>
2019-10-20 17:28 ` Marvin Häuser [this message]
2019-10-21 3:11 ` [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size Liming Gao
[not found] ` <15CF8AE5AC785DF0.32129@groups.io>
2019-11-04 2:11 ` [edk2-devel] " Liming Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB7PR07MB4917B4F1813CF3CADA94F078806E0@DB7PR07MB4917.eurprd07.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox