* [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size
[not found] <aa5718fc4fdc610f03912cfcfd6fd8760d866117.1571592440.git.mhaeuser@outlook.de>
@ 2019-10-20 17:28 ` Marvin Häuser
2019-10-21 3:11 ` Liming Gao
[not found] ` <15CF8AE5AC785DF0.32129@groups.io>
0 siblings, 2 replies; 3+ messages in thread
From: Marvin Häuser @ 2019-10-20 17:28 UTC (permalink / raw)
To: devel@edk2.groups.io; +Cc: vit9696@protonmail.com, Michael D Kinney, Liming Gao
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size
2019-10-20 17:28 ` [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size Marvin Häuser
@ 2019-10-21 3:11 ` Liming Gao
[not found] ` <15CF8AE5AC785DF0.32129@groups.io>
1 sibling, 0 replies; 3+ messages in thread
From: Liming Gao @ 2019-10-21 3:11 UTC (permalink / raw)
To: Marvin.Haeuser@outlook.com, devel@edk2.groups.io
Cc: vit9696@protonmail.com, Kinney, Michael D
Reviewed-by: Liming Gao <liming.gao@intel.com>
>-----Original Message-----
>From: Marvin Häuser [mailto:Marvin.Haeuser@outlook.com]
>Sent: Monday, October 21, 2019 1:28 AM
>To: devel@edk2.groups.io
>Cc: vit9696@protonmail.com; Kinney, Michael D
><michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size
>
>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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size
[not found] ` <15CF8AE5AC785DF0.32129@groups.io>
@ 2019-11-04 2:11 ` Liming Gao
0 siblings, 0 replies; 3+ messages in thread
From: Liming Gao @ 2019-11-04 2:11 UTC (permalink / raw)
To: devel@edk2.groups.io, Gao, Liming, Marvin.Haeuser@outlook.com
Cc: vit9696@protonmail.com, Kinney, Michael D
Push @ 787c4baace1c0c49fa1628990402be8997294d17
>-----Original Message-----
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Liming Gao
>Sent: Monday, October 21, 2019 11:12 AM
>To: Marvin.Haeuser@outlook.com; devel@edk2.groups.io
>Cc: vit9696@protonmail.com; Kinney, Michael D <michael.d.kinney@intel.com>
>Subject: Re: [edk2-devel] [PATCH] MdePkg/UefiDebugLibStdErr: Pass the
>correct buffer size
>
>Reviewed-by: Liming Gao <liming.gao@intel.com>
>
>>-----Original Message-----
>>From: Marvin Häuser [mailto:Marvin.Haeuser@outlook.com]
>>Sent: Monday, October 21, 2019 1:28 AM
>>To: devel@edk2.groups.io
>>Cc: vit9696@protonmail.com; Kinney, Michael D
>><michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
>>Subject: [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size
>>
>>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
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-04 2:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <aa5718fc4fdc610f03912cfcfd6fd8760d866117.1571592440.git.mhaeuser@outlook.de>
2019-10-20 17:28 ` [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size Marvin Häuser
2019-10-21 3:11 ` Liming Gao
[not found] ` <15CF8AE5AC785DF0.32129@groups.io>
2019-11-04 2:11 ` [edk2-devel] " Liming Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox