From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.128.66; helo=mail-wm1-f66.google.com; envelope-from=philmd@redhat.com; receiver=edk2-devel@lists.01.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (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 E78F32118D94A for ; Wed, 7 Nov 2018 09:12:52 -0800 (PST) Received: by mail-wm1-f66.google.com with SMTP id s10-v6so14859791wmc.5 for ; Wed, 07 Nov 2018 09:12:52 -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=4HBBO6LySztVECN6994L2xgtY4vVf8ff2aue1PCWW5A=; b=VqtwA2/qgfFnrQvkW123oS5MBHwfXPYZL9Dja2AlhS/rFTvMDgCC8QjHvUFq011fuD Hw9VN3hDdkqE5at0BTxeOGOFnbHeajouGUXfGS9tXkvMjT1JrP4ZbnxNI3u96KX+VVj1 zRwyiLWQ/Qbw4oLRiTDqiUqYY2WKgXwth/cHTh/H0o/GxgF06chmGeNqdXDyTMedddyJ JBL8HxsHppohtlaLzk96Sc4OeF/+EP8OJgwBKb6D1ZjxC1QF+F4/SvRe/QbLWw+G8BfC Hc3G0sC8oodeEwGMq5UnWs9o+HYLClqnzxO3/ftj6QIzGqdz9zVDm0Pyw1esVDOrL8CG U5RQ== X-Gm-Message-State: AGRZ1gI0Xx76RgwR/s5xZ5eHjdfn/s9YR8AZP8zDouG1BkWwo9Qlpp7L 6LZTN938TnHEbbEkA0JR9++mEA== X-Google-Smtp-Source: AJdET5f6/Umz6nPqQhaxIM2fSeSnQOpjAAYpsHGQE748Lak05SKtrsUgG84+kARAkk3a7KPXnxVYuw== X-Received: by 2002:a1c:5689:: with SMTP id k131-v6mr902204wmb.119.1541610771349; Wed, 07 Nov 2018 09:12:51 -0800 (PST) Received: from [10.0.0.124] ([185.102.219.36]) by smtp.gmail.com with ESMTPSA id z5-v6sm782660wmi.32.2018.11.07.09.12.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 09:12:50 -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: <88f787f6-5bb5-13ce-3e1a-7e223f8a1481@redhat.com> Date: Wed, 7 Nov 2018 18:12:43 +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 2/2] MdePkg/UefiDebugLibStdErr: 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:53 -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/UefiDebugLibStdErr/DebugLib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c > index 6830a3caa1fe..837fb49b3a21 100644 > --- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c > +++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c > @@ -71,7 +71,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); > > // >