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.1787.1589477496201838839 for ; Thu, 14 May 2020 10:31:37 -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 F0221CD465; Thu, 14 May 2020 20:31:32 +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 V7 1/1] MdePkg: Fix SafeString performing assertions on runtime checks Date: Thu, 14 May 2020 20:31:31 +0300 Message-Id: <20200514173131.38072-2-cheptsov@ispras.ru> X-Mailer: git-send-email 2.24.2 (Apple Git-127) In-Reply-To: <20200514173131.38072-1-cheptsov@ispras.ru> References: <20200514173131.38072-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 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 --- MdePkg/Include/Library/BaseLib.h | 111 ------------------- MdePkg/Library/BaseLib/SafeString.c | 112 -------------------- 2 files changed, 223 deletions(-) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h index ecadff8b23..2c194ad943 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -189,7 +189,6 @@ StrnSizeS ( =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 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 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 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 ( 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 ( 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 ( 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 ( 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 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 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 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 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 ( 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 ( 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 ( 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 ( 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 ( "::" 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,16 +1503,8 @@ StrToIpv6Address ( 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 by EndPointer.=0D @@ -1640,8 +1568,6 @@ StrToIpv4Address ( 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 +1602,6 @@ StrToGuid ( =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 +1692,6 @@ UnicodeStrToAsciiStr ( 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 @@ -1824,7 +1738,6 @@ UnicodeStrToAsciiStrS ( 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 =0D @@ -2388,10 +2301,6 @@ AsciiStrHexToUint64 ( "::" 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 +2352,6 @@ AsciiStrToIpv6Address ( 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 +2413,6 @@ AsciiStrToIpv4Address ( 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 +2443,6 @@ AsciiStrToGuid ( 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 +2523,6 @@ AsciiStrToUnicodeStr ( 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 +2568,6 @@ AsciiStrToUnicodeStrS ( ((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 index 7dc03d2caa..41d9137b83 100644 --- a/MdePkg/Library/BaseLib/SafeString.c +++ b/MdePkg/Library/BaseLib/SafeString.c @@ -14,7 +14,6 @@ =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 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 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 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 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 ( 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 ( 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 ( 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 ( 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 @@ -1091,16 +1066,8 @@ StrHexToUint64S ( "::" 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 @@ -1317,16 +1284,8 @@ StrToIpv6Address ( 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 by EndPointer.=0D @@ -1482,8 +1441,6 @@ StrToIpv4Address ( 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 @@ -1589,17 +1546,6 @@ StrToGuid ( =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 @@ -1779,8 +1725,6 @@ AsciiStrnSizeS ( =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 @@ -1856,8 +1800,6 @@ AsciiStrCpyS ( =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 +1886,6 @@ AsciiStrnCpyS ( =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 +1980,6 @@ AsciiStrCatS ( =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 +2092,6 @@ AsciiStrnCatS ( 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 +2198,6 @@ AsciiStrDecimalToUintnS ( 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 +2308,6 @@ AsciiStrDecimalToUint64S ( 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 +2429,6 @@ AsciiStrHexToUintnS ( 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 +2549,6 @@ AsciiStrHexToUint64S ( 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 +2648,6 @@ UnicodeStrToAsciiStrS ( 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 @@ -2855,7 +2767,6 @@ UnicodeStrnToAsciiStrS ( 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 @@ -2948,7 +2859,6 @@ AsciiStrToUnicodeStrS ( ((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 +2982,6 @@ AsciiStrnToUnicodeStrS ( "::" 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 +3197,6 @@ AsciiStrToIpv6Address ( 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 +3350,6 @@ AsciiStrToIpv4Address ( 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 +3449,6 @@ AsciiStrToGuid ( 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 --=20 2.24.2 (Apple Git-127)