From nobody Fri May 3 10:59:11 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+49261+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+49261+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 1571585792593660.1429168507004; Sun, 20 Oct 2019 08:36:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xPHIYY1788612xxl09VmEejj; Sun, 20 Oct 2019 08:36:31 -0700 X-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 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 X-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 X-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 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 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: [edk2-devel] [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-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-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 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: LjxlVejUDUl3LhJvf0fiwXHSx1787277AA= 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=1571585791; bh=7peQvK5MblNnLyHwc/RVwYZJxLiB/mqGkuVCTN/WoWQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=wYjCjUxZXGB556Z7a2uhhnXuTDc+JcCc3eo6JZI2phht8LplQ2LnI5PMUHTAv2G/eqs 6zZwcdGJUgshd9Y3qaUL/VyRoDwY7dwrvNqajvGJZlY/JqCoQa/bFzQzSaXmZHe1GuouV wSpvXBi3L+kM5hZQq7mWTHW8bYeV2sPLi1Q= 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/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 // 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 --=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 (#49261): https://edk2.groups.io/g/devel/message/49261 Mute This Topic: https://groups.io/mt/35954838/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-