From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: ispras.ru, ip: 83.149.199.45, mailfrom: cheptsov@ispras.ru) 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: [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> X-Mailer: git-send-email 2.24.2 (Apple Git-127) In-Reply-To: <20200514092537.29609-1-cheptsov@ispras.ru> References: <20200514092537.29609-1-cheptsov@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2054=0D =0D Runtime checks returned via status return code should not work as=0D assertions to permit parsing not trusted data with SafeString=0D interfaces.=0D =0D CC: Andrew Fish =0D CC: Ard Biesheuvel =0D CC: Bret Barkelew =0D CC: Brian J. Johnson =0D CC: Chasel Chiu =0D CC: Jordan Justen =0D CC: Laszlo Ersek =0D CC: Leif Lindholm =0D CC: Liming Gao =0D CC: Marvin H=C3=A4user =0D CC: Mike Kinney =0D CC: Vincent Zimmer =0D CC: Zhichao Gao =0D Signed-off-by: Vitaly Cheptsov =0D ---=0D MdePkg/Include/Library/BaseLib.h | 120 ++------------------=0D MdePkg/Library/BaseLib/SafeString.c | 80 -------------=0D 2 files changed, 7 insertions(+), 193 deletions(-)=0D =0D diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h=0D index ecadff8b23..62dc3151bc 100644=0D --- a/MdePkg/Include/Library/BaseLib.h=0D +++ b/MdePkg/Include/Library/BaseLib.h=0D @@ -189,7 +189,6 @@ StrnSizeS (=0D =0D If Destination is not aligned on a 16-bit boundary, then ASSERT().=0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -225,7 +224,6 @@ StrCpyS (=0D =0D If Length > 0 and Destination is not aligned on a 16-bit boundary, then = ASSERT().=0D If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSER= T().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -263,7 +261,6 @@ StrnCpyS (=0D =0D If Destination is not aligned on a 16-bit boundary, then ASSERT().=0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -303,7 +300,6 @@ StrCatS (=0D =0D If Destination is not aligned on a 16-bit boundary, then ASSERT().=0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -350,12 +346,7 @@ StrnCatS (=0D be ignored. Then, the function stops at the first character that is a no= t a=0D valid decimal character or a Null-terminator, whichever one comes first.= =0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D - PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D =0D If String has no valid decimal digits in the above format, then 0 is sto= red=0D at the location pointed to by Data.=0D @@ -406,12 +397,7 @@ StrDecimalToUintnS (=0D be ignored. Then, the function stops at the first character that is a no= t a=0D valid decimal character or a Null-terminator, whichever one comes first.= =0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D - PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D =0D If String has no valid decimal digits in the above format, then 0 is sto= red=0D at the location pointed to by Data.=0D @@ -467,12 +453,7 @@ StrDecimalToUint64S (=0D the first character that is a not a valid hexadecimal character or NULL,= =0D whichever one comes first.=0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D - PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D =0D If String has no valid hexadecimal digits in the above format, then 0 is= =0D stored at the location pointed to by Data.=0D @@ -528,12 +509,7 @@ StrHexToUintnS (=0D the first character that is a not a valid hexadecimal character or NULL,= =0D whichever one comes first.=0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D - PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D =0D If String has no valid hexadecimal digits in the above format, then 0 is= =0D stored at the location pointed to by Data.=0D @@ -622,8 +598,6 @@ AsciiStrnSizeS (=0D =0D This function is similar as strcpy_s defined in C11.=0D =0D - If an error would be returned, then the function will also ASSERT().=0D -=0D If an error is returned, then the Destination is unmodified.=0D =0D @param Destination A pointer to a Null-terminated Ascii st= ring.=0D @@ -656,8 +630,6 @@ AsciiStrCpyS (=0D =0D This function is similar as strncpy_s defined in C11.=0D =0D - If an error would be returned, then the function will also ASSERT().=0D -=0D If an error is returned, then the Destination is unmodified.=0D =0D @param Destination A pointer to a Null-terminated Ascii st= ring.=0D @@ -692,8 +664,6 @@ AsciiStrnCpyS (=0D =0D This function is similar as strcat_s defined in C11.=0D =0D - If an error would be returned, then the function will also ASSERT().=0D -=0D If an error is returned, then the Destination is unmodified.=0D =0D @param Destination A pointer to a Null-terminated Ascii st= ring.=0D @@ -730,8 +700,6 @@ AsciiStrCatS (=0D =0D This function is similar as strncat_s defined in C11.=0D =0D - If an error would be returned, then the function will also ASSERT().=0D -=0D If an error is returned, then the Destination is unmodified.=0D =0D @param Destination A pointer to a Null-terminated Ascii st= ring.=0D @@ -777,12 +745,6 @@ AsciiStrnCatS (=0D be ignored. Then, the function stops at the first character that is a no= t a=0D valid decimal character or a Null-terminator, whichever one comes first.= =0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D - If PcdMaximumAsciiStringLength is not zero, and String contains more tha= n=0D - PcdMaximumAsciiStringLength Ascii characters, not including the=0D - Null-terminator, then ASSERT().=0D -=0D If String has no valid decimal digits in the above format, then 0 is sto= red=0D at the location pointed to by Data.=0D If the number represented by String exceeds the range defined by UINTN, = then=0D @@ -832,12 +794,6 @@ AsciiStrDecimalToUintnS (=0D be ignored. Then, the function stops at the first character that is a no= t a=0D valid decimal character or a Null-terminator, whichever one comes first.= =0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D - If PcdMaximumAsciiStringLength is not zero, and String contains more tha= n=0D - PcdMaximumAsciiStringLength Ascii characters, not including the=0D - Null-terminator, then ASSERT().=0D -=0D If String has no valid decimal digits in the above format, then 0 is sto= red=0D at the location pointed to by Data.=0D If the number represented by String exceeds the range defined by UINT64,= then=0D @@ -891,12 +847,6 @@ AsciiStrDecimalToUint64S (=0D character that is a not a valid hexadecimal character or Null-terminator= ,=0D whichever on comes first.=0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D - If PcdMaximumAsciiStringLength is not zero, and String contains more tha= n=0D - PcdMaximumAsciiStringLength Ascii characters, not including the=0D - Null-terminator, then ASSERT().=0D -=0D If String has no valid hexadecimal digits in the above format, then 0 is= =0D stored at the location pointed to by Data.=0D If the number represented by String exceeds the range defined by UINTN, = then=0D @@ -950,12 +900,6 @@ AsciiStrHexToUintnS (=0D character that is a not a valid hexadecimal character or Null-terminator= ,=0D whichever on comes first.=0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D - If PcdMaximumAsciiStringLength is not zero, and String contains more tha= n=0D - PcdMaximumAsciiStringLength Ascii characters, not including the=0D - Null-terminator, then ASSERT().=0D -=0D If String has no valid hexadecimal digits in the above format, then 0 is= =0D stored at the location pointed to by Data.=0D If the number represented by String exceeds the range defined by UINT64,= then=0D @@ -1506,16 +1450,8 @@ StrHexToUint64 (=0D "::" can be used to compress one or more groups of X when X contains onl= y 0.=0D The "::" can only appear once in the String.=0D =0D - If String is NULL, then ASSERT().=0D -=0D - If Address is NULL, then ASSERT().=0D -=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D =0D - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D - PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D -=0D If EndPointer is not NULL and Address is translated from String, a point= er=0D to the character that stopped the scan is stored at the location pointed= to=0D by EndPointer.=0D @@ -1567,15 +1503,10 @@ StrToIpv6Address (=0D When /P is in the String, the function stops at the first character that= is not=0D a valid decimal digit character after P is converted.=0D =0D - If String is NULL, then ASSERT().=0D -=0D - If Address is NULL, then ASSERT().=0D -=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D =0D If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D =0D If EndPointer is not NULL and Address is translated from String, a point= er=0D to the character that stopped the scan is stored at the location pointed= to=0D @@ -1640,8 +1571,6 @@ StrToIpv4Address (=0D oo Data4[48:55]=0D pp Data4[56:63]=0D =0D - If String is NULL, then ASSERT().=0D - If Guid is NULL, then ASSERT().=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D =0D @param String Pointer to a Null-terminated Unicode st= ring.=0D @@ -1676,17 +1605,6 @@ StrToGuid (=0D =0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D =0D - If String is NULL, then ASSERT().=0D -=0D - If Buffer is NULL, then ASSERT().=0D -=0D - If Length is not multiple of 2, then ASSERT().=0D -=0D - If PcdMaximumUnicodeStringLength is not zero and Length is greater than= =0D - PcdMaximumUnicodeStringLength, then ASSERT().=0D -=0D - If MaxBufferSize is less than (Length / 2), then ASSERT().=0D -=0D @param String Pointer to a Null-terminated Unicode st= ring.=0D @param Length The number of Unicode characters to dec= ode.=0D @param Buffer Pointer to the converted bytes array.=0D @@ -1777,7 +1695,6 @@ UnicodeStrToAsciiStr (=0D the upper 8 bits, then ASSERT().=0D =0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -1818,22 +1735,23 @@ UnicodeStrToAsciiStrS (=0D bits of each Unicode character. The function terminates the Ascii string= =0D Destination by appending a Null-terminator character at the end.=0D =0D - The caller is responsible to make sure Destination points to a buffer wi= th size=0D - equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.= =0D + The caller is responsible to make sure Destination points to a buffer wi= th=0D + size not smaller than ((MIN(StrLen(Source), Length) + 1) * sizeof (CHAR8= ))=0D + in bytes.=0D =0D If any Unicode characters in Source contain non-zero value in the upper = 8=0D bits, then ASSERT().=0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D - If an error is returned, then the Destination is unmodified.=0D + If an error is returned, then Destination and DestinationLength are=0D + unmodified.=0D =0D @param Source The pointer to a Null-terminated Unicode stri= ng.=0D @param Length The maximum number of Unicode characters to=0D convert.=0D @param Destination The pointer to a Null-terminated Ascii string= .=0D - @param DestMax The maximum number of Destination Ascii=0D - char, including terminating null char.=0D + @param DestMax The maximum number of Destination Ascii char,= =0D + including terminating null char.=0D @param DestinationLength The number of Unicode characters converted.=0D =0D @retval RETURN_SUCCESS String is converted.=0D @@ -2388,10 +2306,6 @@ AsciiStrHexToUint64 (=0D "::" can be used to compress one or more groups of X when X contains onl= y 0.=0D The "::" can only appear once in the String.=0D =0D - If String is NULL, then ASSERT().=0D -=0D - If Address is NULL, then ASSERT().=0D -=0D If EndPointer is not NULL and Address is translated from String, a point= er=0D to the character that stopped the scan is stored at the location pointed= to=0D by EndPointer.=0D @@ -2443,10 +2357,6 @@ AsciiStrToIpv6Address (=0D When /P is in the String, the function stops at the first character that= is not=0D a valid decimal digit character after P is converted.=0D =0D - If String is NULL, then ASSERT().=0D -=0D - If Address is NULL, then ASSERT().=0D -=0D If EndPointer is not NULL and Address is translated from String, a point= er=0D to the character that stopped the scan is stored at the location pointed= to=0D by EndPointer.=0D @@ -2508,9 +2418,6 @@ AsciiStrToIpv4Address (=0D oo Data4[48:55]=0D pp Data4[56:63]=0D =0D - If String is NULL, then ASSERT().=0D - If Guid is NULL, then ASSERT().=0D -=0D @param String Pointer to a Null-terminated ASCII stri= ng.=0D @param Guid Pointer to the converted GUID.=0D =0D @@ -2541,17 +2448,6 @@ AsciiStrToGuid (=0D decoding stops after Length of characters and outputs Buffer containing= =0D (Length / 2) bytes.=0D =0D - If String is NULL, then ASSERT().=0D -=0D - If Buffer is NULL, then ASSERT().=0D -=0D - If Length is not multiple of 2, then ASSERT().=0D -=0D - If PcdMaximumAsciiStringLength is not zero and Length is greater than=0D - PcdMaximumAsciiStringLength, then ASSERT().=0D -=0D - If MaxBufferSize is less than (Length / 2), then ASSERT().=0D -=0D @param String Pointer to a Null-terminated ASCII stri= ng.=0D @param Length The number of ASCII characters to decod= e.=0D @param Buffer Pointer to the converted bytes array.=0D @@ -2632,7 +2528,6 @@ AsciiStrToUnicodeStr (=0D equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in = bytes.=0D =0D If Destination is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -2678,7 +2573,6 @@ AsciiStrToUnicodeStrS (=0D ((MIN(AsciiStrLen(Source), Length) + 1) * sizeof (CHAR8)) in bytes.=0D =0D If Destination is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then Destination and DestinationLength are=0D unmodified.=0D diff --git a/MdePkg/Library/BaseLib/SafeString.c b/MdePkg/Library/BaseLib/S= afeString.c=0D index 7dc03d2caa..1db42abb05 100644=0D --- a/MdePkg/Library/BaseLib/SafeString.c=0D +++ b/MdePkg/Library/BaseLib/SafeString.c=0D @@ -14,7 +14,6 @@=0D =0D #define SAFE_STRING_CONSTRAINT_CHECK(Expression, Status) \=0D do { \=0D - ASSERT (Expression); \=0D if (!(Expression)) { \=0D return Status; \=0D } \=0D @@ -197,7 +196,6 @@ StrnSizeS (=0D =0D If Destination is not aligned on a 16-bit boundary, then ASSERT().=0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -279,7 +277,6 @@ StrCpyS (=0D =0D If Length > 0 and Destination is not aligned on a 16-bit boundary, then = ASSERT().=0D If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSER= T().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -372,7 +369,6 @@ StrnCpyS (=0D =0D If Destination is not aligned on a 16-bit boundary, then ASSERT().=0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -473,7 +469,6 @@ StrCatS (=0D =0D If Destination is not aligned on a 16-bit boundary, then ASSERT().=0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -590,12 +585,7 @@ StrnCatS (=0D be ignored. Then, the function stops at the first character that is a no= t a=0D valid decimal character or a Null-terminator, whichever one comes first.= =0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D - PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D =0D If String has no valid decimal digits in the above format, then 0 is sto= red=0D at the location pointed to by Data.=0D @@ -705,12 +695,7 @@ StrDecimalToUintnS (=0D be ignored. Then, the function stops at the first character that is a no= t a=0D valid decimal character or a Null-terminator, whichever one comes first.= =0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D - PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D =0D If String has no valid decimal digits in the above format, then 0 is sto= red=0D at the location pointed to by Data.=0D @@ -825,12 +810,7 @@ StrDecimalToUint64S (=0D the first character that is a not a valid hexadecimal character or NULL,= =0D whichever one comes first.=0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D - PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D =0D If String has no valid hexadecimal digits in the above format, then 0 is= =0D stored at the location pointed to by Data.=0D @@ -956,12 +936,7 @@ StrHexToUintnS (=0D the first character that is a not a valid hexadecimal character or NULL,= =0D whichever one comes first.=0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D If String is not aligned in a 16-bit boundary, then ASSERT().=0D - If PcdMaximumUnicodeStringLength is not zero, and String contains more t= han=0D - PcdMaximumUnicodeStringLength Unicode characters, not including the=0D - Null-terminator, then ASSERT().=0D =0D If String has no valid hexadecimal digits in the above format, then 0 is= =0D stored at the location pointed to by Data.=0D @@ -1856,8 +1831,6 @@ AsciiStrCpyS (=0D =0D This function is similar as strncpy_s defined in C11.=0D =0D - If an error would be returned, then the function will also ASSERT().=0D -=0D If an error is returned, then the Destination is unmodified.=0D =0D @param Destination A pointer to a Null-terminated Ascii st= ring.=0D @@ -1944,8 +1917,6 @@ AsciiStrnCpyS (=0D =0D This function is similar as strcat_s defined in C11.=0D =0D - If an error would be returned, then the function will also ASSERT().=0D -=0D If an error is returned, then the Destination is unmodified.=0D =0D @param Destination A pointer to a Null-terminated Ascii st= ring.=0D @@ -2040,8 +2011,6 @@ AsciiStrCatS (=0D =0D This function is similar as strncat_s defined in C11.=0D =0D - If an error would be returned, then the function will also ASSERT().=0D -=0D If an error is returned, then the Destination is unmodified.=0D =0D @param Destination A pointer to a Null-terminated Ascii st= ring.=0D @@ -2154,12 +2123,6 @@ AsciiStrnCatS (=0D be ignored. Then, the function stops at the first character that is a no= t a=0D valid decimal character or a Null-terminator, whichever one comes first.= =0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D - If PcdMaximumAsciiStringLength is not zero, and String contains more tha= n=0D - PcdMaximumAsciiStringLength Ascii characters, not including the=0D - Null-terminator, then ASSERT().=0D -=0D If String has no valid decimal digits in the above format, then 0 is sto= red=0D at the location pointed to by Data.=0D If the number represented by String exceeds the range defined by UINTN, = then=0D @@ -2266,12 +2229,6 @@ AsciiStrDecimalToUintnS (=0D be ignored. Then, the function stops at the first character that is a no= t a=0D valid decimal character or a Null-terminator, whichever one comes first.= =0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D - If PcdMaximumAsciiStringLength is not zero, and String contains more tha= n=0D - PcdMaximumAsciiStringLength Ascii characters, not including the=0D - Null-terminator, then ASSERT().=0D -=0D If String has no valid decimal digits in the above format, then 0 is sto= red=0D at the location pointed to by Data.=0D If the number represented by String exceeds the range defined by UINT64,= then=0D @@ -2382,12 +2339,6 @@ AsciiStrDecimalToUint64S (=0D character that is a not a valid hexadecimal character or Null-terminator= ,=0D whichever on comes first.=0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D - If PcdMaximumAsciiStringLength is not zero, and String contains more tha= n=0D - PcdMaximumAsciiStringLength Ascii characters, not including the=0D - Null-terminator, then ASSERT().=0D -=0D If String has no valid hexadecimal digits in the above format, then 0 is= =0D stored at the location pointed to by Data.=0D If the number represented by String exceeds the range defined by UINTN, = then=0D @@ -2509,12 +2460,6 @@ AsciiStrHexToUintnS (=0D character that is a not a valid hexadecimal character or Null-terminator= ,=0D whichever on comes first.=0D =0D - If String is NULL, then ASSERT().=0D - If Data is NULL, then ASSERT().=0D - If PcdMaximumAsciiStringLength is not zero, and String contains more tha= n=0D - PcdMaximumAsciiStringLength Ascii characters, not including the=0D - Null-terminator, then ASSERT().=0D -=0D If String has no valid hexadecimal digits in the above format, then 0 is= =0D stored at the location pointed to by Data.=0D If the number represented by String exceeds the range defined by UINT64,= then=0D @@ -2635,7 +2580,6 @@ AsciiStrHexToUint64S (=0D the upper 8 bits, then ASSERT().=0D =0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then the Destination is unmodified.=0D =0D @@ -2735,7 +2679,6 @@ UnicodeStrToAsciiStrS (=0D If any Unicode characters in Source contain non-zero value in the upper = 8=0D bits, then ASSERT().=0D If Source is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then Destination and DestinationLength are=0D unmodified.=0D @@ -2948,7 +2891,6 @@ AsciiStrToUnicodeStrS (=0D ((MIN(AsciiStrLen(Source), Length) + 1) * sizeof (CHAR8)) in bytes.=0D =0D If Destination is not aligned on a 16-bit boundary, then ASSERT().=0D - If an error would be returned, then the function will also ASSERT().=0D =0D If an error is returned, then Destination and DestinationLength are=0D unmodified.=0D @@ -3072,10 +3014,6 @@ AsciiStrnToUnicodeStrS (=0D "::" can be used to compress one or more groups of X when X contains onl= y 0.=0D The "::" can only appear once in the String.=0D =0D - If String is NULL, then ASSERT().=0D -=0D - If Address is NULL, then ASSERT().=0D -=0D If EndPointer is not NULL and Address is translated from String, a point= er=0D to the character that stopped the scan is stored at the location pointed= to=0D by EndPointer.=0D @@ -3291,10 +3229,6 @@ AsciiStrToIpv6Address (=0D When /P is in the String, the function stops at the first character that= is not=0D a valid decimal digit character after P is converted.=0D =0D - If String is NULL, then ASSERT().=0D -=0D - If Address is NULL, then ASSERT().=0D -=0D If EndPointer is not NULL and Address is translated from String, a point= er=0D to the character that stopped the scan is stored at the location pointed= to=0D by EndPointer.=0D @@ -3448,9 +3382,6 @@ AsciiStrToIpv4Address (=0D oo Data4[48:55]=0D pp Data4[56:63]=0D =0D - If String is NULL, then ASSERT().=0D - If Guid is NULL, then ASSERT().=0D -=0D @param String Pointer to a Null-terminated ASCII stri= ng.=0D @param Guid Pointer to the converted GUID.=0D =0D @@ -3550,17 +3481,6 @@ AsciiStrToGuid (=0D decoding stops after Length of characters and outputs Buffer containing= =0D (Length / 2) bytes.=0D =0D - If String is NULL, then ASSERT().=0D -=0D - If Buffer is NULL, then ASSERT().=0D -=0D - If Length is not multiple of 2, then ASSERT().=0D -=0D - If PcdMaximumAsciiStringLength is not zero and Length is greater than=0D - PcdMaximumAsciiStringLength, then ASSERT().=0D -=0D - If MaxBufferSize is less than (Length / 2), then ASSERT().=0D -=0D @param String Pointer to a Null-terminated ASCII stri= ng.=0D @param Length The number of ASCII characters to decod= e.=0D @param Buffer Pointer to the converted bytes array.=0D -- =0D 2.24.2 (Apple Git-127)=0D =0D