From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.92.67.15; helo=eur02-am5-obe.outbound.protection.outlook.com; envelope-from=marvin.haeuser@outlook.com; receiver=edk2-devel@lists.01.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067015.outbound.protection.outlook.com [40.92.67.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 814EE2118AA9F for ; Mon, 5 Nov 2018 04:54:46 -0800 (PST) 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=TsGyzxvppm5t2TE/L5eUdr2S0JTJyv8C9W6obNG7EP8=; b=nmSxRyu/i0NQxXdeuq8OfT1jyRgBlfTvwu+4rQv1q9X5yLDwEvmx/0AH3+h3fjmD2jHM8UfxUMi5ImyUwzJV/D4KCCVsjjk8NkyCWYYq13s2goZNWuqB2Ddjsr5KaYcp1ovvc7cJ1bEkQQWQ67gEQ2cXjcVROklQBljmOHnJIMMoBIJMEML3UvhAxtSSc24YUu8WhJYGq4IngqOWiS8oXeEkpofzl+9m7TR4UyXq/ZQt1A9ujka8069Co0dA0aIHYZoYXsOFdg/ooBxwrxsJdyGHOoYXoycibIWu4f+CiayYiYQArTk33rhDCs4DZGDwI8S7+mb7e7p4Txd7WxfheA== Received: from AM5EUR02FT059.eop-EUR02.prod.protection.outlook.com (10.152.8.53) by AM5EUR02HT061.eop-EUR02.prod.protection.outlook.com (10.152.9.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.14; Mon, 5 Nov 2018 12:54:44 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com (10.152.8.56) by AM5EUR02FT059.mail.protection.outlook.com (10.152.9.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.14 via Frontend Transport; Mon, 5 Nov 2018 12:54:44 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::342c:bfb5:c08a:e4de]) by VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::342c:bfb5:c08a:e4de%9]) with mapi id 15.20.1294.032; Mon, 5 Nov 2018 12:54:44 +0000 From: =?iso-8859-1?Q?Marvin_H=E4user?= To: "edk2-devel@lists.01.org" CC: "michael.d.kinney@intel.com" , "liming.gao@intel.com" Thread-Topic: [PATCH 1/2] MdePkg/UefiDebugLibConOut: Pass the correct buffer size. Thread-Index: AQHUdQa5AJjM0N9dbEissqkBuQdpLQ== Date: Mon, 5 Nov 2018 12:54:44 +0000 Message-ID: References: In-Reply-To: Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0051.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::28) To VI1PR0801MB1790.eurprd08.prod.outlook.com (2603:10a6:800:5b::15) x-incomingtopheadermarker: OriginalChecksum:B593F9C32919E6C8547B3FC4B14FE3BE767CB1B71ACC6DBCED0B9991B60070E0; UpperCasedChecksum:FF45F5EE268077B2BFA0DCDC35288590DC136287F014CF9C3E4C439984170FE8; SizeAsReceived:7629; Count:50 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [GOb4wcPe68dA+sQNu2PFFrExcO990F7R] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5EUR02HT061; 6:Kr9+gOQk++SsnZpmJdkg4Bex5I6j53hotVIqhIMYXm9/stHSDvIzlzqj0ffmRgC78cCTl14pyXOF2QbQCd3MMjSJsRNhbuLjXAOJlZFcDBZ1njFL9m334pRm9wK4RCYFEETDRmt7NAgyyoydxe/IwklGJxJO3XBibv07CoMXIJE20Or/PL06hJ6Y/P8hG//Z/QQPnFssQMULQyQnhv5nSQ4W0HRpmY02o6kPGMQSXy/9uqY4R1EUrZYk5FMYe/mDyJHquSQJQAfWpuykLWjAoUAwgJuU33oBhIxdg1hkfpYUaISw7Fm/VbJ9HsydYC8Zzx9HLeTz+OGlo1w7PfOzklU0t9zntOrjMlZf8It57F5XkyBjVnqfepcAnLjPfnp7oZNLHcp0GcpB7jxRROW/Sc2UhYrR66oUQRE/iOmObKHvDRwqmNr5hfqmQIFrBRAvwAZAQnaHrJ1pGW83Pdolzg==; 5:oweAULdrQqV955SKvzRclRhx4xFmHz24E05+bC0CnHouaJCqsYoOpTMAnZbds+8tnj+bh+MbOi9dpiuwd40IO5jcIU/2o/Hv86iJyj+/TODLJd2ifMudHyoMO0oTAuTWJ6hWNkIiKL8f3m0B/i8I5QQ1/Mpv7yxTsK0B6/U2vmo=; 7:I/cWAxSCUBeR0aFvoaOFzFcXkRYb1qmZAdBcH6Xm4FYvYC4kkMvvtcR1AAe65KYy0dDZp1mnTQYvTERPJe23KBayyG+RRBMe3KzCoH5MZQ7EgbUIAieH0aZNAQLqiUUU8Wj0SDXuuBJqX8HwkiRpNg== x-incomingheadercount: 50 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101475)(1601125500)(1701031045); SRVR:AM5EUR02HT061; x-ms-traffictypediagnostic: AM5EUR02HT061: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(4566010)(82015058); SRVR:AM5EUR02HT061; BCL:0; PCL:0; RULEID:; SRVR:AM5EUR02HT061; x-microsoft-antispam-message-info: eicpfAgBiC3WtG00WMCZjIQ7zZc659+iTBhE0jxtbcwNWzbMzVFNq5BVltXEMisu MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-Network-Message-Id: d0f1e6fe-d265-4a3b-5905-08d6431ddb4c X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2018 12:54:44.1408 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR02HT061 Subject: [PATCH 1/2] MdePkg/UefiDebugLibConOut: Pass the correct buffer size. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 12:54:47 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The second argument of "UnicodeVSPrintAsciiFormat" is "BufferSize", which takes the size of the buffer in bytes. Replace the currently used MAX_DEBUG_MESSAGE_LENGTH reference, which is the buffer's length, with the actual buffer size. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser --- MdePkg/Library/UefiDebugLibConOut/DebugLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c b/MdePkg/Library/= UefiDebugLibConOut/DebugLib.c index f04207c93fe8..5aaf106762ea 100644 --- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c +++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c @@ -69,7 +69,7 @@ DebugPrint ( // Convert the DEBUG() message to a Unicode String // VA_START (Marker, Format); - UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, Ma= rker); + UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker); VA_END (Marker); =20 =20 --=20 2.19.1.windows.1