Reviewed-by: Liming Gao <liming....@intel.com> >-----Original Message----- >From: Marvin Häuser [mailto:marvin.haeu...@outlook.com] >Sent: Monday, October 21, 2019 1:28 AM >To: devel@edk2.groups.io >Cc: vit9...@protonmail.com; Kinney, Michael D ><michael.d.kin...@intel.com>; Gao, Liming <liming....@intel.com> >Subject: [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size > >From: Marvin Haeuser <mhaeu...@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.kin...@intel.com> >Cc: Liming Gao <liming....@intel.com> >Signed-off-by: Marvin Haeuser <mhaeu...@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
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49272): https://edk2.groups.io/g/devel/message/49272 Mute This Topic: https://groups.io/mt/36272499/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-