From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhichao.gao@intel.com) Received: from mga18.intel.com (mga18.intel.com []) by groups.io with SMTP; Thu, 27 Jun 2019 21:29:12 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2019 20:58:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,426,1557212400"; d="scan'208";a="183599691" Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 27 Jun 2019 20:58:01 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Laszlo Ersek Subject: [PATCH 3/3] MdePkg/BaseLib: Base64Decode: Add decription for RETURN_SUCCESS Date: Fri, 28 Jun 2019 11:57:46 +0800 Message-Id: <20190628035746.24160-4-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190628035746.24160-1-zhichao.gao@intel.com> References: <20190628035746.24160-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1891 While the convertion Base64 ascii string is null string (the string only contain white space would be regard as null string), there would be no decodeable data. Set *DestinationSize to zero and return RETURN_SUCCESS. But it is not mention in the comment of the function. So add this decription. Cc: Michael D Kinney Cc: Liming Gao Cc: Laszlo Ersek Signed-off-by: Zhichao Gao --- MdePkg/Library/BaseLib/String.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c index 7ebc2ecddd..8829d2cbbf 100644 --- a/MdePkg/Library/BaseLib/String.c +++ b/MdePkg/Library/BaseLib/String.c @@ -1929,7 +1929,8 @@ Base64Encode ( @param DestinationSize Caller is responsible for passing in buffer of at least DestinationSize. Set 0 to get the size needed. Set to bytes stored on return. - @retval RETURN_SUCCESS When binary buffer is filled in. + @retval RETURN_SUCCESS When binary buffer is filled in. Or if the Base64 ascii string is empty, set + *DestinationSize to zero to indicate this case. @retval RETURN_INVALID_PARAMETER If Source is NULL or DestinationSize is NULL. @retval RETURN_INVALID_PARAMETER If SourceLength or DestinationSize is bigger than (MAX_ADDRESS -(UINTN)Destination ). @retval RETURN_INVALID_PARAMETER If there is any invalid character in input stream. -- 2.21.0.windows.1