public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marvin Häuser" <Marvin.Haeuser@outlook.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "michael.d.kinney@intel.com" <michael.d.kinney@intel.com>,
	"liming.gao@intel.com" <liming.gao@intel.com>
Subject: [PATCH 2/2] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size.
Date: Mon, 5 Nov 2018 12:54:44 +0000	[thread overview]
Message-ID: <VI1PR0801MB17909A4F8E4AC56BCDF1ECE180CA0@VI1PR0801MB1790.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <cover.1541422290.git.Marvin.Haeuser@outlook.com>

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 MdePkg/Library/UefiDebugLibStdErr/DebugLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
index 6830a3caa1fe..837fb49b3a21 100644
--- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
+++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
@@ -71,7 +71,7 @@ DebugPrint (
   // Convert the DEBUG() message to a Unicode String
   //
   VA_START (Marker, Format);
-  UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, Marker);
+  UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker);
   VA_END (Marker);
 
   //
-- 
2.19.1.windows.1



       reply	other threads:[~2018-11-05 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1541422290.git.Marvin.Haeuser@outlook.com>
2018-11-05 12:54 ` Marvin Häuser [this message]
2018-11-07 17:12   ` [PATCH 2/2] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size Philippe Mathieu-Daudé
2018-11-05 12:54 ` [PATCH 1/2] MdePkg/UefiDebugLibConOut: " Marvin Häuser
2018-11-07 17:12   ` Philippe Mathieu-Daudé
2018-11-12 11:31   ` Philippe Mathieu-Daudé

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=VI1PR0801MB17909A4F8E4AC56BCDF1ECE180CA0@VI1PR0801MB1790.eurprd08.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