From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.92.68.76]) by mx.groups.io with SMTP id smtpd.web12.1505.1571573317595218455 for ; Sun, 20 Oct 2019 05:08:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=usauiD37; spf=pass (domain: outlook.com, ip: 40.92.68.76, mailfrom: marvin.haeuser@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KgvkvytWXPflXIYmkrVa4g2uhrWs4yRtTbyJDtX5sHdUb9QCotnbRWmomBUxcpJOxKHqjJlTQpHF+SAIB5mAi7UkTq5MmpH6q/odTdrMZz5SU3BCNqAsDF8n35jb0ow6NNee9zmZyPuIlhh966QilylkjU7b7mhjAc3BLj9YzInXhZ++2E9bF2GXKctQ9fuh/vCH7ftSpo5M64kCZ2GlX7vRK0lgm7RGz+iSCZsxnllbl58OHqLuRexTO3BlwbaS5LPyzxe1fUkLXJENf7rGJFKFxx6DHmaLA2bD9+Fh4My7eOj/HMX1Ck8gYCJ0po+Lnqu4UxAp9dPrewdRCVIOgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ACFF+Yb//NbhbUo1ZRtoGJICeWYPj1D8nfaKNiAm2Pc=; b=Ivop6NgrSSAhN98OtCnKpEQsMfGuYpr/Gnc40aVhv8SRD1lOcXwm7TtW68YJHYx1/IOERHD2ghncwOyxqIvFjncUo1Foiw/q/6tJUJPJAPKF2/29aklJU0Gr+j4hmoB/kHS2OiFMhYPwHl+mImMvsbgKUYN7tYL3SlszR8ruP0jutLaThEl4OusdVs6OJ8yH4HVXQ39B2Fvo5w01q6FlnxgScyNo6hdSOCSqiGUX8u1DPyGOgRxbkFKEgQQViIm0iYkVK8K/vdnNtLN2zH/hNvLkQX5UedkOT7ysFZ47cu3Cy5rpa8f7gks3RdTzKNZl+DazcLFJwqcmoC2uR5EwpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ACFF+Yb//NbhbUo1ZRtoGJICeWYPj1D8nfaKNiAm2Pc=; b=usauiD372gooIlkS9NNX2KM26C8xWSkIlsAnnfYWpiRm9XIKn1/dm41jD/qraQHckRkHeY940v1QydzxuQQgJP94HgLIe6n5+StE+NnbI2tKyi/7jQjpiUn0qnLzAY1Klx9pNqPUaNEck2vtM0QtodofRehQcO15N+WnkkGI3FggWYiXBHg4IroTtQQdfE0ofAhFWoe8lZ/Yh/aqmNemvUV2a4iiqJdEvpkobu03JszffdPPnxo89VA6QbUma2ETp7IApMHtNV5EnujrzAfRTl0ESvnYVu2AgFN7lwhHPwzDEQJi37Zwt9/gPVzAGUb+J4huZ766H8iOhtsBlK+lOw== Received: from VE1EUR02FT003.eop-EUR02.prod.protection.outlook.com (10.152.12.55) by VE1EUR02HT069.eop-EUR02.prod.protection.outlook.com (10.152.13.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2367.14; Sun, 20 Oct 2019 12:08:35 +0000 Received: from DB7PR07MB4917.eurprd07.prod.outlook.com (10.152.12.58) by VE1EUR02FT003.mail.protection.outlook.com (10.152.12.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2367.14 via Frontend Transport; Sun, 20 Oct 2019 12:08:35 +0000 Received: from DB7PR07MB4917.eurprd07.prod.outlook.com ([fe80::1b8:f59a:96de:82ef]) by DB7PR07MB4917.eurprd07.prod.outlook.com ([fe80::1b8:f59a:96de:82ef%3]) with mapi id 15.20.2367.021; Sun, 20 Oct 2019 12:08:35 +0000 From: =?iso-8859-1?Q?Marvin_H=E4user?= To: "devel@edk2.groups.io" CC: "vit9696@protonmail.com" , Michael D Kinney , Liming Gao Subject: [PATCH] MdePkg/UefiDebugLibConOut: Pass the correct buffer size Thread-Topic: [PATCH] MdePkg/UefiDebugLibConOut: Pass the correct buffer size Thread-Index: AQHVhz8Z020yyw6cdECMUbwWeU3acg== Date: Sun, 20 Oct 2019 12:08:35 +0000 Message-ID: References: In-Reply-To: Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR01CA0052.eurprd01.prod.exchangelabs.com (2603:10a6:208:e6::29) To DB7PR07MB4917.eurprd07.prod.outlook.com (2603:10a6:10:5f::30) x-incomingtopheadermarker: OriginalChecksum:E23D0DE60859E08CDCFC5405975EAB312A6B993C9274E41D631F8B8C79E99851;UpperCasedChecksum:BFE96E1D371D7BEAC81979F4779FC024EA5F3E9D2F8855CF6E2419F1EE3D3F46;SizeAsReceived:7772;Count:51 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.23.0.windows.1 x-tmn: [7X3Agj1lMpYsLnVvd5BBZqzr047+x839] x-microsoft-original-message-id: <7d47ed0d557b8a66227abe6fc8797f8640af0145.1571572996.git.mhaeuser@outlook.de> x-ms-publictraffictype: Email x-incomingheadercount: 51 x-eopattributedmessage: 0 x-ms-traffictypediagnostic: VE1EUR02HT069: x-ms-exchange-purlcount: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /4xelkLm5YCfgqRQvlzS0MIwngWVWZ7GpAee2zSvc+55BAyuVmEYHoAbKevjGSvEHyZEHuqFp8H29xiftVwi+w1jSjj6nKVrMbpZ2KsTkUHD4WIVwf33PH08FQh0jyQDQf63hLqH2jPmlPQHwn/yGPlk+hdnxVadQIDJBOmNJIvUpRLXAsmkpi7Jh398WJtTLV102eVpcBk8t0E1urdBHcpO+bmgTuxTryFcGspDaJA= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: d7f0bb67-9ba0-47c1-66e6-08d755563b4e X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2019 12:08:35.1108 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT069 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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/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=0D //=0D if (BaseListMarker =3D=3D NULL) {=0D - UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format= , VaListMarker);=0D + UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, VaListMa= rker);=0D } else {=0D - UnicodeBSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format= , BaseListMarker);=0D + UnicodeBSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, BaseList= Marker);=0D }=0D =0D =0D --=20 2.23.0.windows.1