From nobody Thu May 2 13:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+49310+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49310+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=outlook.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1571669856563303.7954387367199; Mon, 21 Oct 2019 07:57:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id kzNyYY1788612xPvaIVmiS4Q; Mon, 21 Oct 2019 07:57:36 -0700 X-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 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 X-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 X-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 X-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: [edk2-devel] [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-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-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 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,Marvin.Haeuser@outlook.com X-Gm-Message-State: kmpPrIILxylmVVOLcMfEdisyx1787277AA= Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1571669856; bh=A/8dyt8l37w08aOjuYzCeQsXq3dFwaywQRsnaGBTcZo=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=vwo3JAjnUARAksy+eRkUKrAZbHpRuxLfK3mc1U85SxZ3Lg9pdqz+4PpWQzdM6Idk+B0 OTRHZLXIVtlafBR5IK0oPVZT6rwAYttJyBTL9SD/9BUz2uFUzC4pYWAXTCsU3WOH4QQqe azNS/8g6sLzOUdEq0oqrIhV0wm0RFJ7KMrw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Liming Gao --- 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, VaListMa= rker); } else { - UnicodeBSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format,= BaseListMarker); + UnicodeBSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, BaseList= Marker); } =20 // --=20 2.23.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49310): https://edk2.groups.io/g/devel/message/49310 Mute This Topic: https://groups.io/mt/36272499/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-