From nobody Thu May 2 16:02:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+59525+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59525+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=ispras.ru ARC-Seal: i=1; a=rsa-sha256; t=1589448345; cv=none; d=zohomail.com; s=zohoarc; b=H5oddqb5PrOn94DnG8QLqi9nedhBHa/AS+lY+M67exPbFwbtzOvB1ZX8vsdYz7xiHL5/pnIZOvf78K8R3O/qLYfrn+EEf/W1lgu4itjqjt9PHcLqh3LJJfEeUK62UpbFyBZ7bNU/WToOiaoTi0SjS3wdpfiGqWbYCgdr7yfcDSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589448345; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=gAPDdZh2M7SLbMHim5c1W5kBQ4IJxKackDZ36CgwdV0=; b=P5zltwuKfbT085NsTTOb17OtvfkCOAgo1FSIG8hj3WxQkn3gvMu/VBooelPiHEMa5Ye5qSkf1iMZkvKyOvoN94A/Io65ntMbhqdzYi9iMiEPJnuiY7ZvYW6rMse9MpSRo/OGEZVPcPRrRytwBiIqMrwZUKKR+8+5pnsRtnOAkg8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59525+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1589448345528233.59713024443533; Thu, 14 May 2020 02:25:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Cu0cYY1788612x69aLHCAoHA; Thu, 14 May 2020 02:25:44 -0700 X-Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.45]) by mx.groups.io with SMTP id smtpd.web10.8929.1589448342686746048 for ; Thu, 14 May 2020 02:25:43 -0700 X-Received: from localhost.localdomain (unknown [77.232.9.83]) by mail.ispras.ru (Postfix) with ESMTPSA id 1D626CD465; Thu, 14 May 2020 12:25:39 +0300 (MSK) From: "Vitaly Cheptsov" To: devel@edk2.groups.io Cc: Andrew Fish , Ard Biesheuvel , Bret Barkelew , "Brian J . Johnson" , Chasel Chiu , Jordan Justen , Laszlo Ersek , Leif Lindholm , Liming Gao , =?UTF-8?q?Marvin=20H=C3=A4user?= , Mike Kinney , Vincent Zimmer , Zhichao Gao Subject: [edk2-devel] [PATCH V6 1/1] MdePkg: Fix SafeString performing assertions on runtime checks Date: Thu, 14 May 2020 12:25:37 +0300 Message-Id: <20200514092537.29609-2-cheptsov@ispras.ru> In-Reply-To: <20200514092537.29609-1-cheptsov@ispras.ru> References: <20200514092537.29609-1-cheptsov@ispras.ru> MIME-Version: 1.0 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,cheptsov@ispras.ru X-Gm-Message-State: t6MXnobUqMg6Ng8mLg0VwDdTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589448344; bh=HEqkKBKKYO2D9752yYToNimyNJ1ueXXQM1kTPKYMKqA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=HYJMpdCQdVi1qEN+WGDHpQI4W2MibuI5YjBiP2W+ESKsiizYIkYPD9+MMdRTsb1Jdia FlEAjMwO5dxP9k4QIXeuSUOE4fKmw6vUmPrZkLHgni/0ryScIzhqf7BipxSR7xciBh77R 19uIOeQQK7fUXqCPbSeaHJdt08sYqyLQ1N4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2054 Runtime checks returned via status return code should not work as assertions to permit parsing not trusted data with SafeString interfaces. CC: Andrew Fish CC: Ard Biesheuvel CC: Bret Barkelew CC: Brian J. Johnson CC: Chasel Chiu CC: Jordan Justen CC: Laszlo Ersek CC: Leif Lindholm CC: Liming Gao CC: Marvin H=C3=A4user CC: Mike Kinney CC: Vincent Zimmer CC: Zhichao Gao Signed-off-by: Vitaly Cheptsov Acked-by: Ard Biesheuvel --- MdePkg/Include/Library/BaseLib.h | 120 ++------------------ MdePkg/Library/BaseLib/SafeString.c | 80 ------------- 2 files changed, 7 insertions(+), 193 deletions(-) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h index ecadff8b23..62dc3151bc 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -189,7 +189,6 @@ StrnSizeS ( =20 If Destination is not aligned on a 16-bit boundary, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -225,7 +224,6 @@ StrCpyS ( =20 If Length > 0 and Destination is not aligned on a 16-bit boundary, then = ASSERT(). If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSER= T(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -263,7 +261,6 @@ StrnCpyS ( =20 If Destination is not aligned on a 16-bit boundary, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -303,7 +300,6 @@ StrCatS ( =20 If Destination is not aligned on a 16-bit boundary, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -350,12 +346,7 @@ StrnCatS ( be ignored. Then, the function stops at the first character that is a no= t a valid decimal character or a Null-terminator, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). =20 If String has no valid decimal digits in the above format, then 0 is sto= red at the location pointed to by Data. @@ -406,12 +397,7 @@ StrDecimalToUintnS ( be ignored. Then, the function stops at the first character that is a no= t a valid decimal character or a Null-terminator, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). =20 If String has no valid decimal digits in the above format, then 0 is sto= red at the location pointed to by Data. @@ -467,12 +453,7 @@ StrDecimalToUint64S ( the first character that is a not a valid hexadecimal character or NULL, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). =20 If String has no valid hexadecimal digits in the above format, then 0 is stored at the location pointed to by Data. @@ -528,12 +509,7 @@ StrHexToUintnS ( the first character that is a not a valid hexadecimal character or NULL, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). =20 If String has no valid hexadecimal digits in the above format, then 0 is stored at the location pointed to by Data. @@ -622,8 +598,6 @@ AsciiStrnSizeS ( =20 This function is similar as strcpy_s defined in C11. =20 - If an error would be returned, then the function will also ASSERT(). - If an error is returned, then the Destination is unmodified. =20 @param Destination A pointer to a Null-terminated Ascii st= ring. @@ -656,8 +630,6 @@ AsciiStrCpyS ( =20 This function is similar as strncpy_s defined in C11. =20 - If an error would be returned, then the function will also ASSERT(). - If an error is returned, then the Destination is unmodified. =20 @param Destination A pointer to a Null-terminated Ascii st= ring. @@ -692,8 +664,6 @@ AsciiStrnCpyS ( =20 This function is similar as strcat_s defined in C11. =20 - If an error would be returned, then the function will also ASSERT(). - If an error is returned, then the Destination is unmodified. =20 @param Destination A pointer to a Null-terminated Ascii st= ring. @@ -730,8 +700,6 @@ AsciiStrCatS ( =20 This function is similar as strncat_s defined in C11. =20 - If an error would be returned, then the function will also ASSERT(). - If an error is returned, then the Destination is unmodified. =20 @param Destination A pointer to a Null-terminated Ascii st= ring. @@ -777,12 +745,6 @@ AsciiStrnCatS ( be ignored. Then, the function stops at the first character that is a no= t a valid decimal character or a Null-terminator, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength Ascii characters, not including the - Null-terminator, then ASSERT(). - If String has no valid decimal digits in the above format, then 0 is sto= red at the location pointed to by Data. If the number represented by String exceeds the range defined by UINTN, = then @@ -832,12 +794,6 @@ AsciiStrDecimalToUintnS ( be ignored. Then, the function stops at the first character that is a no= t a valid decimal character or a Null-terminator, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength Ascii characters, not including the - Null-terminator, then ASSERT(). - If String has no valid decimal digits in the above format, then 0 is sto= red at the location pointed to by Data. If the number represented by String exceeds the range defined by UINT64,= then @@ -891,12 +847,6 @@ AsciiStrDecimalToUint64S ( character that is a not a valid hexadecimal character or Null-terminator, whichever on comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength Ascii characters, not including the - Null-terminator, then ASSERT(). - If String has no valid hexadecimal digits in the above format, then 0 is stored at the location pointed to by Data. If the number represented by String exceeds the range defined by UINTN, = then @@ -950,12 +900,6 @@ AsciiStrHexToUintnS ( character that is a not a valid hexadecimal character or Null-terminator, whichever on comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength Ascii characters, not including the - Null-terminator, then ASSERT(). - If String has no valid hexadecimal digits in the above format, then 0 is stored at the location pointed to by Data. If the number represented by String exceeds the range defined by UINT64,= then @@ -1506,16 +1450,8 @@ StrHexToUint64 ( "::" can be used to compress one or more groups of X when X contains onl= y 0. The "::" can only appear once in the String. =20 - If String is NULL, then ASSERT(). - - If Address is NULL, then ASSERT(). - If String is not aligned in a 16-bit boundary, then ASSERT(). =20 - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). - If EndPointer is not NULL and Address is translated from String, a point= er to the character that stopped the scan is stored at the location pointed= to by EndPointer. @@ -1567,15 +1503,10 @@ StrToIpv6Address ( When /P is in the String, the function stops at the first character that= is not a valid decimal digit character after P is converted. =20 - If String is NULL, then ASSERT(). - - If Address is NULL, then ASSERT(). - If String is not aligned in a 16-bit boundary, then ASSERT(). =20 If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). =20 If EndPointer is not NULL and Address is translated from String, a point= er to the character that stopped the scan is stored at the location pointed= to @@ -1640,8 +1571,6 @@ StrToIpv4Address ( oo Data4[48:55] pp Data4[56:63] =20 - If String is NULL, then ASSERT(). - If Guid is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). =20 @param String Pointer to a Null-terminated Unicode st= ring. @@ -1676,17 +1605,6 @@ StrToGuid ( =20 If String is not aligned in a 16-bit boundary, then ASSERT(). =20 - If String is NULL, then ASSERT(). - - If Buffer is NULL, then ASSERT(). - - If Length is not multiple of 2, then ASSERT(). - - If PcdMaximumUnicodeStringLength is not zero and Length is greater than - PcdMaximumUnicodeStringLength, then ASSERT(). - - If MaxBufferSize is less than (Length / 2), then ASSERT(). - @param String Pointer to a Null-terminated Unicode st= ring. @param Length The number of Unicode characters to dec= ode. @param Buffer Pointer to the converted bytes array. @@ -1777,7 +1695,6 @@ UnicodeStrToAsciiStr ( the upper 8 bits, then ASSERT(). =20 If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -1818,22 +1735,23 @@ UnicodeStrToAsciiStrS ( bits of each Unicode character. The function terminates the Ascii string Destination by appending a Null-terminator character at the end. =20 - The caller is responsible to make sure Destination points to a buffer wi= th size - equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes. + The caller is responsible to make sure Destination points to a buffer wi= th + size not smaller than ((MIN(StrLen(Source), Length) + 1) * sizeof (CHAR8= )) + in bytes. =20 If any Unicode characters in Source contain non-zero value in the upper 8 bits, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 - If an error is returned, then the Destination is unmodified. + If an error is returned, then Destination and DestinationLength are + unmodified. =20 @param Source The pointer to a Null-terminated Unicode stri= ng. @param Length The maximum number of Unicode characters to convert. @param Destination The pointer to a Null-terminated Ascii string. - @param DestMax The maximum number of Destination Ascii - char, including terminating null char. + @param DestMax The maximum number of Destination Ascii char, + including terminating null char. @param DestinationLength The number of Unicode characters converted. =20 @retval RETURN_SUCCESS String is converted. @@ -2388,10 +2306,6 @@ AsciiStrHexToUint64 ( "::" can be used to compress one or more groups of X when X contains onl= y 0. The "::" can only appear once in the String. =20 - If String is NULL, then ASSERT(). - - If Address is NULL, then ASSERT(). - If EndPointer is not NULL and Address is translated from String, a point= er to the character that stopped the scan is stored at the location pointed= to by EndPointer. @@ -2443,10 +2357,6 @@ AsciiStrToIpv6Address ( When /P is in the String, the function stops at the first character that= is not a valid decimal digit character after P is converted. =20 - If String is NULL, then ASSERT(). - - If Address is NULL, then ASSERT(). - If EndPointer is not NULL and Address is translated from String, a point= er to the character that stopped the scan is stored at the location pointed= to by EndPointer. @@ -2508,9 +2418,6 @@ AsciiStrToIpv4Address ( oo Data4[48:55] pp Data4[56:63] =20 - If String is NULL, then ASSERT(). - If Guid is NULL, then ASSERT(). - @param String Pointer to a Null-terminated ASCII stri= ng. @param Guid Pointer to the converted GUID. =20 @@ -2541,17 +2448,6 @@ AsciiStrToGuid ( decoding stops after Length of characters and outputs Buffer containing (Length / 2) bytes. =20 - If String is NULL, then ASSERT(). - - If Buffer is NULL, then ASSERT(). - - If Length is not multiple of 2, then ASSERT(). - - If PcdMaximumAsciiStringLength is not zero and Length is greater than - PcdMaximumAsciiStringLength, then ASSERT(). - - If MaxBufferSize is less than (Length / 2), then ASSERT(). - @param String Pointer to a Null-terminated ASCII stri= ng. @param Length The number of ASCII characters to decod= e. @param Buffer Pointer to the converted bytes array. @@ -2632,7 +2528,6 @@ AsciiStrToUnicodeStr ( equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in = bytes. =20 If Destination is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -2678,7 +2573,6 @@ AsciiStrToUnicodeStrS ( ((MIN(AsciiStrLen(Source), Length) + 1) * sizeof (CHAR8)) in bytes. =20 If Destination is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then Destination and DestinationLength are unmodified. diff --git a/MdePkg/Library/BaseLib/SafeString.c b/MdePkg/Library/BaseLib/S= afeString.c index 7dc03d2caa..1db42abb05 100644 --- a/MdePkg/Library/BaseLib/SafeString.c +++ b/MdePkg/Library/BaseLib/SafeString.c @@ -14,7 +14,6 @@ =20 #define SAFE_STRING_CONSTRAINT_CHECK(Expression, Status) \ do { \ - ASSERT (Expression); \ if (!(Expression)) { \ return Status; \ } \ @@ -197,7 +196,6 @@ StrnSizeS ( =20 If Destination is not aligned on a 16-bit boundary, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -279,7 +277,6 @@ StrCpyS ( =20 If Length > 0 and Destination is not aligned on a 16-bit boundary, then = ASSERT(). If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSER= T(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -372,7 +369,6 @@ StrnCpyS ( =20 If Destination is not aligned on a 16-bit boundary, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -473,7 +469,6 @@ StrCatS ( =20 If Destination is not aligned on a 16-bit boundary, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -590,12 +585,7 @@ StrnCatS ( be ignored. Then, the function stops at the first character that is a no= t a valid decimal character or a Null-terminator, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). =20 If String has no valid decimal digits in the above format, then 0 is sto= red at the location pointed to by Data. @@ -705,12 +695,7 @@ StrDecimalToUintnS ( be ignored. Then, the function stops at the first character that is a no= t a valid decimal character or a Null-terminator, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). =20 If String has no valid decimal digits in the above format, then 0 is sto= red at the location pointed to by Data. @@ -825,12 +810,7 @@ StrDecimalToUint64S ( the first character that is a not a valid hexadecimal character or NULL, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). =20 If String has no valid hexadecimal digits in the above format, then 0 is stored at the location pointed to by Data. @@ -956,12 +936,7 @@ StrHexToUintnS ( the first character that is a not a valid hexadecimal character or NULL, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). If String is not aligned in a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). =20 If String has no valid hexadecimal digits in the above format, then 0 is stored at the location pointed to by Data. @@ -1856,8 +1831,6 @@ AsciiStrCpyS ( =20 This function is similar as strncpy_s defined in C11. =20 - If an error would be returned, then the function will also ASSERT(). - If an error is returned, then the Destination is unmodified. =20 @param Destination A pointer to a Null-terminated Ascii st= ring. @@ -1944,8 +1917,6 @@ AsciiStrnCpyS ( =20 This function is similar as strcat_s defined in C11. =20 - If an error would be returned, then the function will also ASSERT(). - If an error is returned, then the Destination is unmodified. =20 @param Destination A pointer to a Null-terminated Ascii st= ring. @@ -2040,8 +2011,6 @@ AsciiStrCatS ( =20 This function is similar as strncat_s defined in C11. =20 - If an error would be returned, then the function will also ASSERT(). - If an error is returned, then the Destination is unmodified. =20 @param Destination A pointer to a Null-terminated Ascii st= ring. @@ -2154,12 +2123,6 @@ AsciiStrnCatS ( be ignored. Then, the function stops at the first character that is a no= t a valid decimal character or a Null-terminator, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength Ascii characters, not including the - Null-terminator, then ASSERT(). - If String has no valid decimal digits in the above format, then 0 is sto= red at the location pointed to by Data. If the number represented by String exceeds the range defined by UINTN, = then @@ -2266,12 +2229,6 @@ AsciiStrDecimalToUintnS ( be ignored. Then, the function stops at the first character that is a no= t a valid decimal character or a Null-terminator, whichever one comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength Ascii characters, not including the - Null-terminator, then ASSERT(). - If String has no valid decimal digits in the above format, then 0 is sto= red at the location pointed to by Data. If the number represented by String exceeds the range defined by UINT64,= then @@ -2382,12 +2339,6 @@ AsciiStrDecimalToUint64S ( character that is a not a valid hexadecimal character or Null-terminator, whichever on comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength Ascii characters, not including the - Null-terminator, then ASSERT(). - If String has no valid hexadecimal digits in the above format, then 0 is stored at the location pointed to by Data. If the number represented by String exceeds the range defined by UINTN, = then @@ -2509,12 +2460,6 @@ AsciiStrHexToUintnS ( character that is a not a valid hexadecimal character or Null-terminator, whichever on comes first. =20 - If String is NULL, then ASSERT(). - If Data is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength Ascii characters, not including the - Null-terminator, then ASSERT(). - If String has no valid hexadecimal digits in the above format, then 0 is stored at the location pointed to by Data. If the number represented by String exceeds the range defined by UINT64,= then @@ -2635,7 +2580,6 @@ AsciiStrHexToUint64S ( the upper 8 bits, then ASSERT(). =20 If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then the Destination is unmodified. =20 @@ -2735,7 +2679,6 @@ UnicodeStrToAsciiStrS ( If any Unicode characters in Source contain non-zero value in the upper 8 bits, then ASSERT(). If Source is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then Destination and DestinationLength are unmodified. @@ -2948,7 +2891,6 @@ AsciiStrToUnicodeStrS ( ((MIN(AsciiStrLen(Source), Length) + 1) * sizeof (CHAR8)) in bytes. =20 If Destination is not aligned on a 16-bit boundary, then ASSERT(). - If an error would be returned, then the function will also ASSERT(). =20 If an error is returned, then Destination and DestinationLength are unmodified. @@ -3072,10 +3014,6 @@ AsciiStrnToUnicodeStrS ( "::" can be used to compress one or more groups of X when X contains onl= y 0. The "::" can only appear once in the String. =20 - If String is NULL, then ASSERT(). - - If Address is NULL, then ASSERT(). - If EndPointer is not NULL and Address is translated from String, a point= er to the character that stopped the scan is stored at the location pointed= to by EndPointer. @@ -3291,10 +3229,6 @@ AsciiStrToIpv6Address ( When /P is in the String, the function stops at the first character that= is not a valid decimal digit character after P is converted. =20 - If String is NULL, then ASSERT(). - - If Address is NULL, then ASSERT(). - If EndPointer is not NULL and Address is translated from String, a point= er to the character that stopped the scan is stored at the location pointed= to by EndPointer. @@ -3448,9 +3382,6 @@ AsciiStrToIpv4Address ( oo Data4[48:55] pp Data4[56:63] =20 - If String is NULL, then ASSERT(). - If Guid is NULL, then ASSERT(). - @param String Pointer to a Null-terminated ASCII stri= ng. @param Guid Pointer to the converted GUID. =20 @@ -3550,17 +3481,6 @@ AsciiStrToGuid ( decoding stops after Length of characters and outputs Buffer containing (Length / 2) bytes. =20 - If String is NULL, then ASSERT(). - - If Buffer is NULL, then ASSERT(). - - If Length is not multiple of 2, then ASSERT(). - - If PcdMaximumAsciiStringLength is not zero and Length is greater than - PcdMaximumAsciiStringLength, then ASSERT(). - - If MaxBufferSize is less than (Length / 2), then ASSERT(). - @param String Pointer to a Null-terminated ASCII stri= ng. @param Length The number of ASCII characters to decod= e. @param Buffer Pointer to the converted bytes array. --=20 2.24.2 (Apple Git-127) -=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 (#59525): https://edk2.groups.io/g/devel/message/59525 Mute This Topic: https://groups.io/mt/74201257/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-