From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.92.65.72]) by mx.groups.io with SMTP id smtpd.web11.1001.1571592496904212662 for ; Sun, 20 Oct 2019 10:28:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=om/pnkbv; spf=pass (domain: outlook.com, ip: 40.92.65.72, mailfrom: marvin.haeuser@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJiFbLIcx3J0/xJum+UxzkBKA1mseUj3xC15hBQpzWy8MY7J3QA00uqxHDtMoWGFzByVHSTmIxA+Cxah4fKktXuMXW+eUxcUUqU/qUdEFxMdpJqLiapoQ+ZDpxEPUM+r3VgBrVP6bgaFF2b7dejFeBfaZbYK0tK/FrFjSzjc/P9ft0Lok3xtgnEo8+oF4+9/Xqo8W9VCVA1kbyB2GamQF7HEr/brbmDeGtEKfBE0NVGZ/kncYBejp9TgO7AV7CDmqNeOkhIrpFb4Hq5JojZ0QRt/lFwxwc4gQYvw+azzxM+eRK58TJzbF1zAxHrYa41hVbXrs4olA8eDj0dJY5GT+g== 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=BMHsMUMiboa86g+AZbwhfdDuePkyQbAzF+BZNexfrPs=; b=oC4cipybTGAU2zcHUjMRZDSSepFI4jlm2hoFAB76HKcjCua9aBnnjgKG3xjzGW0+KoZJZtXfm63BzpPNKfiuIxjBjI3mVoyWcggWNsAJjvKxiUx1GVHwZhaGrrIfl8OSkPcFb3o5SaquEFxJmym7lF8LSNyi5GV1HExq+oHUdemCeQpJTdPf8Her2UnY01PQGEkhYB3ZGmUEAl0QiyuqGISYGpduz+53mZqIq59atfWUbx9mR6bgNs51l2eTeod7fmiisP1al2qOnvb59dUAHYLWhnfcu54Axq2ug9Cg/4HuM36B62ViXMM2C2Avq6YpBwEQ/LVX9vOA9Dls8J/huw== 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=BMHsMUMiboa86g+AZbwhfdDuePkyQbAzF+BZNexfrPs=; b=om/pnkbviEsWO/pMJj9CSMqqhYAmKOM2szaFsDK64DKU9z+k/W3kRiAdiIbLqp8LfpKvT7guIQsqKYAwm6a16t9qFnkS0XtB/bv5Iyok/sMbvmZQW7g3dn+nuNSMXOEsBeyCjTpRHzCaC8YqQ6DSnCa5IjJqjzrJkrf2jfeQfVf9m2FfCUs4DSVM1n8Dr2GX/I4k923U/dG+Ux8PbEo0Oe6F256EJhc8Hh8dGfGUxdte40nx0mkKztHAgX+0C7aMatQOWrFe5eIiV4XD56TJUPkagd0URuJ9gaMwFDTxlbJLQVS4BoBYzXx7PXndpmMOsj8GkDyJWeSr3M9Oev6Q3Q== Received: from DB5EUR01FT032.eop-EUR01.prod.protection.outlook.com (10.152.4.56) by DB5EUR01HT106.eop-EUR01.prod.protection.outlook.com (10.152.5.53) 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 17:28:14 +0000 Received: from DB7PR07MB4917.eurprd07.prod.outlook.com (10.152.4.58) by DB5EUR01FT032.mail.protection.outlook.com (10.152.4.250) 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 17:28:14 +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 17:28:14 +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/UefiDebugLibStdErr: Pass the correct buffer size Thread-Topic: [PATCH] MdePkg/UefiDebugLibStdErr: Pass the correct buffer size Thread-Index: AQHVh2vABaEqdpAiHUamLU6PzbHBbg== Date: Sun, 20 Oct 2019 17:28:14 +0000 Message-ID: References: In-Reply-To: Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM3PR05CA0126.eurprd05.prod.outlook.com (2603:10a6:207:2::28) To DB7PR07MB4917.eurprd07.prod.outlook.com (2603:10a6:10:5f::30) x-incomingtopheadermarker: OriginalChecksum:27593F7E65A252ADDD7E5179249A814995DC6DB1498416E8577FDFD0305B0331;UpperCasedChecksum:CA6087B48A5CB02F6C4FD6C64FA372BE8741195184B7FC51BF6D59ACC2AB863F;SizeAsReceived:7758;Count:51 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.23.0.windows.1 x-tmn: [i4Fwc7RiEhj6FTBtWEcynWX9+UgIuujg] x-microsoft-original-message-id: <9e6d0767f732a6671a23c0860344854dbc19e83a.1571592440.git.mhaeuser@outlook.de> x-ms-publictraffictype: Email x-incomingheadercount: 51 x-eopattributedmessage: 0 x-ms-traffictypediagnostic: DB5EUR01HT106: x-ms-exchange-purlcount: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tYymZ4aekVV87s4BgdhBXNVghXAAZd9xa7ds3yI48yjo2PM0N4l/FqZW1ZXfIvRd/nTg0esV0vU8Jhxyj7RYlEj8vamCgq4FAUCvrXoUmBrKHsdr8S3v9wrnjbApJ84I5TJGBZns0b9ojsf0AIlCPQoGIeBMdtqgkzntiVh791HdAbDp6Nz+cbqY5FYEonnbVDlqSdWjXlAGIQWvPppU/h99UT8/4ewwrTkf7ldt7OM= 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: 289715f4-dd34-4739-2b9b-08d75582e2f4 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2019 17:28:14.4364 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR01HT106 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/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=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