[edk2-devel] [PATCH] MdePkg/UefiDebugLibConOut: Pass the correct buffer size

Liming Gao liming.gao at intel.com
Mon Nov 4 02:11:13 UTC 2019


Push @ 5ae6c993ab75c694831547b7436543a41d60458a

>-----Original Message-----
>From: devel at edk2.groups.io [mailto:devel at edk2.groups.io] On Behalf Of
>Liming Gao
>Sent: Monday, October 21, 2019 11:12 AM
>To: Marvin.Haeuser at outlook.com; devel at edk2.groups.io
>Cc: vit9696 at protonmail.com; Kinney, Michael D <michael.d.kinney at intel.com>
>Subject: Re: [edk2-devel] [PATCH] MdePkg/UefiDebugLibConOut: Pass the
>correct buffer size
>
>Reviewed-by: Liming Gao <liming.gao at intel.com>
>
>>-----Original Message-----
>>From: Marvin Häuser [mailto:Marvin.Haeuser at outlook.com]
>>Sent: Sunday, October 20, 2019 8:09 PM
>>To: devel at edk2.groups.io
>>Cc: vit9696 at protonmail.com; Kinney, Michael D
>><michael.d.kinney at intel.com>; Gao, Liming <liming.gao at intel.com>
>>Subject: [PATCH] MdePkg/UefiDebugLibConOut: Pass the correct buffer size
>>
>>From: Marvin Haeuser <mhaeuser at 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 at intel.com>
>>Cc: Liming Gao <liming.gao at intel.com>
>>Signed-off-by: Marvin Haeuser <mhaeuser at outlook.de>
>>---
>> MdePkg/Library/UefiDebugLibConOut/DebugLib.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>>diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
>>b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
>>index cf168d05cf21..8ea38ea7cc7c 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);
>>
>>     }
>>
>>
>>
>>
>>
>>--
>>2.23.0.windows.1
>
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49896): https://edk2.groups.io/g/devel/message/49896
Mute This Topic: https://groups.io/mt/35954838/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list