From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.221.65; helo=mail-wr1-f65.google.com; envelope-from=philmd@redhat.com; receiver=edk2-devel@lists.01.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7AFF52118D94A for ; Wed, 7 Nov 2018 09:12:35 -0800 (PST) Received: by mail-wr1-f65.google.com with SMTP id y15-v6so18223196wru.9 for ; Wed, 07 Nov 2018 09:12:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c1Jkm+YSRiWzExAR1dcim7B5tfwY2cLxWJc4wE5y2pI=; b=mO7EFWfZaLFN6wz6DvAv/cWUhcczy4hq/soDIwF1VCqeKSlIFI/7em/8ITjZeNKQLG Vv1hanIGBM3LFp5yvMdAM1Ur7Q73RHQpelzwNY+7/llg7v3eLrIBuNFbUfX9qddG7+c8 OD2/wgM+e10reXIQ9c4yY96hgvYS6HrlWEbjDT+CUvMgzrzY3i1HtXHkoEJAXlkhKhqp aB1drwZjY2dkUBD6hXV6mcLFFqicpIogdH80XDUir/+HvnDrzUVxlHA/JvxWKuG/AWcr GYW3uTqK22E3qX6kDKazl+XnFzEkfCwFhnOBps05h+Kpb4YZ4D3+xJBRgAt0kfsvevqv 6xLQ== X-Gm-Message-State: AGRZ1gKQjKh1VE2aYXjcbYwxcIRnkY0fIhwZ4zth1rQVX5YK+vcm4z9D yjFtxEhtGN94xFTvdvZqiPW0qA== X-Google-Smtp-Source: AJdET5d4sEK+Rot82kEDFIhMTpd8bfpb/tlTA9dyBWZeXLKa1RuPOGnqD3mGXoT9Y0h0qIyZ2wkwOA== X-Received: by 2002:a5d:6a4d:: with SMTP id t13-v6mr957689wrw.257.1541610753936; Wed, 07 Nov 2018 09:12:33 -0800 (PST) Received: from [10.0.0.124] ([185.102.219.36]) by smtp.gmail.com with ESMTPSA id y2-v6sm2455528wrh.53.2018.11.07.09.12.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 09:12:33 -0800 (PST) To: =?UTF-8?Q?Marvin_H=c3=a4user?= , "edk2-devel@lists.01.org" Cc: "michael.d.kinney@intel.com" , "liming.gao@intel.com" References: From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <80242a9e-df9a-2a41-35f3-c9c020eb1164@redhat.com> Date: Wed, 7 Nov 2018 18:12:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Subject: Re: [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: Wed, 07 Nov 2018 17:12:35 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit On 5/11/18 13:54, Marvin Häuser wrote: > 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 Reviewed-by: Philippe Mathieu-Daudé > --- > 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, Marker); > + UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker); > VA_END (Marker); > > >