From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Mon, 01 Jul 2019 04:03:55 -0700 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 218A530C3194; Mon, 1 Jul 2019 11:03:50 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (unknown [10.36.118.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE535BA4D; Mon, 1 Jul 2019 11:03:48 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 2/3] MdePkg/BaseLib: Base64Decode: Make DestinationSize complied to spec To: devel@edk2.groups.io, zhichao.gao@intel.com Cc: Michael D Kinney , Liming Gao , Marvin Hauser References: <20190628035746.24160-1-zhichao.gao@intel.com> <20190628035746.24160-3-zhichao.gao@intel.com> From: "Laszlo Ersek" Message-ID: <62dae3a3-3e19-9aa7-dd5a-3a9f9dc02bca@redhat.com> Date: Mon, 1 Jul 2019 13:03:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190628035746.24160-3-zhichao.gao@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 01 Jul 2019 11:03:55 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 06/28/19 05:57, Gao, Zhichao wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1891 > > DestinationSize is decripted as 'Set to bytes stored on return'. > Before return the status, set its converted bytes to be complied > to the decriptions. > DestinationIndex may be overflow if the *DestinationSize is bigger > than (MAX_ADDRESS - 1). Move its incrementation under condition > 'DestinationIndex < *DestinationSize' to make sure it wouldn't be > overflow. > > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Marvin Hauser > Cc: Laszlo Ersek > Signed-off-by: Zhichao Gao > --- > MdePkg/Library/BaseLib/String.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) I'm going to skip this patch because, as I stated under the blurb, I believe that the basic approach of the function implementation is wrong. Thanks Laszlo