From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.255.1571627513576726249 for ; Sun, 20 Oct 2019 20:11:53 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2019 20:11:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,322,1566889200"; d="scan'208";a="201251559" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 20 Oct 2019 20:11:52 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 20 Oct 2019 20:11:52 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 20 Oct 2019 20:11:52 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.33]) with mapi id 14.03.0439.000; Mon, 21 Oct 2019 11:11:50 +0800 From: "Liming Gao" To: "Marvin.Haeuser@outlook.com" , "devel@edk2.groups.io" CC: "vit9696@protonmail.com" , "Kinney, Michael D" Subject: Re: [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size Thread-Topic: [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size Thread-Index: AQHVh2vABaEqdpAiHUamLU6PzbHBbqdka7NQ Date: Mon, 21 Oct 2019 03:11:50 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E51F6B6@SHSMSX104.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Marvin H=E4user [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 >; Gao, Liming >Subject: [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size > >From: Marvin Haeuser > >REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2302 > >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 >Cc: Liming Gao >Signed-off-by: Marvin Haeuser >--- > 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 =3D=3D 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