From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2.protonmail.ch (mail2.protonmail.ch [185.70.40.22]) by mx.groups.io with SMTP id smtpd.web11.7475.1589954188143881499 for ; Tue, 19 May 2020 22:56:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=h7krXjxW; spf=pass (domain: protonmail.com, ip: 185.70.40.22, mailfrom: vit9696@protonmail.com) Date: Wed, 20 May 2020 05:56:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1589954183; bh=HQqGAYW3OS1EWaPckcRBRA0+DZIepK5VtAPcPvz2knw=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=h7krXjxWswkgYmAdbtRpdXnCCCsiMo3xFlTphSGQcIFJfe9NRA3rQrf6cmERHysr+ /R6xztM2/BDkym4PyY5KX1VLvgCzGBFYX0jlrw7Mt8NoxoyKF334TtvxiVdCqYyjHm dRBe1pIEQ2pfnquUfiP2B7bE5XL/Yny0ATKxpwsc= To: Michael D Kinney , Laszlo Ersek From: "Vitaly Cheptsov" Cc: devel@edk2.groups.io, Andrew Fish , Ard Biesheuvel , Bret Barkelew , "Brian J . Johnson" , Chasel Chiu , Jordan Justen , Leif Lindholm , Liming Gao , Marvin H?user , Vincent Zimmer , Zhichao Gao , Jiewen Yao Reply-To: vit9696 Subject: Re: [Patch v8 1/2] MdePkg: Fix SafeString performing assertions on runtime checks Message-ID: <55BDE41D-A3E0-4560-AB37-4FF8C573C668@protonmail.com> In-Reply-To: <20200520030120.21576-2-michael.d.kinney@intel.com> References: <20200520030120.21576-1-michael.d.kinney@intel.com> <20200520030120.21576-2-michael.d.kinney@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.7 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch X-Groupsio-MsgNum: 59938 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="---------------------958ead0e0d4a7ace67eee6ac735f8fa8"; charset=UTF-8 -----------------------958ead0e0d4a7ace67eee6ac735f8fa8 Cc: devel@edk2.groups.io, Andrew Fish , Ard Biesheuvel , Bret Barkelew , "Brian J . Johnson" , Chasel Chiu , Jordan Justen , Leif Lindholm , Liming Gao , Marvin H?user , Vincent Zimmer , Zhichao Gao , Jiewen Yao Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Date: Wed, 20 May 2020 08:56:04 +0300 From: vit9696 In-Reply-To: <20200520030120.21576-2-michael.d.kinney@intel.com> Message-Id: <55BDE41D-A3E0-4560-AB37-4FF8C573C668@protonmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) References: <20200520030120.21576-1-michael.d.kinney@intel.com> <20200520030120.21576-2-michael.d.kinney@intel.com> Subject: Re: [Patch v8 1/2] MdePkg: Fix SafeString performing assertions on runtime checks To: Michael D Kinney , Laszlo Ersek X-Mailer: Apple Mail (2.3608.80.23.2.2) Mike, Looks perfect to me. For everyone: the only change from V7 is an = addition of DEBUG_VERBOSE message, which can indeed be useful. Best wishes, Vitaly > 20 =D0=BC=D0=B0=D1=8F 2020 =D0=B3., =D0=B2 06:01, Michael D Kinney = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0= =B0): >=20 >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2054 >=20 > Runtime checks returned via status return code should not work as > assertions to permit parsing not trusted data with SafeString > interfaces. Replace ASSERT() with a DEBUG_VERBOSE message. >=20 > 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?user > Cc: Michael D Kinney > Cc: Vincent Zimmer > Cc: Zhichao Gao > Cc: Jiewen Yao > Signed-off-by: Vitaly Cheptsov > --- > MdePkg/Include/Library/BaseLib.h | 111 --------------------------- > MdePkg/Library/BaseLib/SafeString.c | 115 +--------------------------- > 2 files changed, 3 insertions(+), 223 deletions(-) >=20 > diff --git a/MdePkg/Include/Library/BaseLib.h = b/MdePkg/Include/Library/BaseLib.h > index b0bbe8cef8..8e7b87cbda 100644 > --- a/MdePkg/Include/Library/BaseLib.h > +++ b/MdePkg/Include/Library/BaseLib.h > @@ -216,7 +216,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 > @@ -252,7 +251,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 = 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 > @@ -290,7 +288,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 > @@ -330,7 +327,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 > @@ -377,12 +373,7 @@ StrnCatS ( > be ignored. Then, the function stops at the first character that is = a not 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 than > - 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 = stored > at the location pointed to by Data. > @@ -433,12 +424,7 @@ StrDecimalToUintnS ( > be ignored. Then, the function stops at the first character that is = a not 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 than > - 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 = stored > at the location pointed to by Data. > @@ -494,12 +480,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 than > - 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. > @@ -555,12 +536,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 than > - 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. > @@ -649,8 +625,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 string. > @@ -683,8 +657,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 string. > @@ -719,8 +691,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 string. > @@ -757,8 +727,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 string. > @@ -804,12 +772,6 @@ AsciiStrnCatS ( > be ignored. Then, the function stops at the first character that is = a not 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 = stored > at the location pointed to by Data. > If the number represented by String exceeds the range defined by = UINTN, then > @@ -859,12 +821,6 @@ AsciiStrDecimalToUintnS ( > be ignored. Then, the function stops at the first character that is = a not 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 = stored > at the location pointed to by Data. > If the number represented by String exceeds the range defined by = UINT64, then > @@ -918,12 +874,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 > @@ -977,12 +927,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 > @@ -1533,16 +1477,8 @@ StrHexToUint64 ( > "::" can be used to compress one or more groups of X when X contains = only 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 than > - PcdMaximumUnicodeStringLength Unicode characters, not including the > - Null-terminator, then ASSERT(). > - > If EndPointer is not NULL and Address is translated from String, a = pointer > to the character that stopped the scan is stored at the location = pointed to > by EndPointer. > @@ -1594,16 +1530,8 @@ 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 than > - PcdMaximumUnicodeStringLength Unicode characters, not including the > - Null-terminator, then ASSERT(). > - > If EndPointer is not NULL and Address is translated from String, a = pointer > to the character that stopped the scan is stored at the location = pointed to > by EndPointer. > @@ -1667,8 +1595,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 string. > @@ -1703,17 +1629,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 string. > @param Length The number of Unicode characters to = decode. > @param Buffer Pointer to the converted bytes = array. > @@ -1804,7 +1719,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 > @@ -1851,7 +1765,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 the Destination is unmodified. >=20 > @@ -2415,10 +2328,6 @@ AsciiStrHexToUint64 ( > "::" can be used to compress one or more groups of X when X contains = only 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 = pointer > to the character that stopped the scan is stored at the location = pointed to > by EndPointer. > @@ -2470,10 +2379,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 = pointer > to the character that stopped the scan is stored at the location = pointed to > by EndPointer. > @@ -2535,9 +2440,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 = string. > @param Guid Pointer to the converted GUID. >=20 > @@ -2568,17 +2470,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 = string. > @param Length The number of ASCII characters to = decode. > @param Buffer Pointer to the converted bytes = array. > @@ -2659,7 +2550,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 > @@ -2705,7 +2595,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/SafeString.c > index 7dc03d2caa..3bb23ca1a1 100644 > --- a/MdePkg/Library/BaseLib/SafeString.c > +++ b/MdePkg/Library/BaseLib/SafeString.c > @@ -14,8 +14,10 @@ >=20 > #define SAFE_STRING_CONSTRAINT_CHECK(Expression, Status) \ > do { \ > - ASSERT (Expression); \ > if (!(Expression)) { \ > + DEBUG ((DEBUG_VERBOSE, \ > + "%a(%d) %a: SAFE_STRING_CONSTRAINT_CHECK(%a) failed. Return = %r\n", \ > + __FILE__, __LINE__, __FUNCTION__, #Expression, Status)); \ > return Status; \ > } \ > } while (FALSE) > @@ -197,7 +199,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 +280,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 = 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 > @@ -372,7 +372,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 +472,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 +588,7 @@ StrnCatS ( > be ignored. Then, the function stops at the first character that is = a not 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 than > - 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 = stored > at the location pointed to by Data. > @@ -705,12 +698,7 @@ StrDecimalToUintnS ( > be ignored. Then, the function stops at the first character that is = a not 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 than > - 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 = stored > at the location pointed to by Data. > @@ -825,12 +813,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 than > - 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 +939,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 than > - 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. > @@ -1091,16 +1069,8 @@ StrHexToUint64S ( > "::" can be used to compress one or more groups of X when X contains = only 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 than > - PcdMaximumUnicodeStringLength Unicode characters, not including the > - Null-terminator, then ASSERT(). > - > If EndPointer is not NULL and Address is translated from String, a = pointer > to the character that stopped the scan is stored at the location = pointed to > by EndPointer. > @@ -1317,16 +1287,8 @@ 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 than > - PcdMaximumUnicodeStringLength Unicode characters, not including the > - Null-terminator, then ASSERT(). > - > If EndPointer is not NULL and Address is translated from String, a = pointer > to the character that stopped the scan is stored at the location = pointed to > by EndPointer. > @@ -1482,8 +1444,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 string. > @@ -1589,17 +1549,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 string. > @param Length The number of Unicode characters to = decode. > @param Buffer Pointer to the converted bytes = array. > @@ -1779,8 +1728,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 string. > @@ -1856,8 +1803,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 string. > @@ -1944,8 +1889,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 string. > @@ -2040,8 +1983,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 string. > @@ -2154,12 +2095,6 @@ AsciiStrnCatS ( > be ignored. Then, the function stops at the first character that is = a not 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 = stored > at the location pointed to by Data. > If the number represented by String exceeds the range defined by = UINTN, then > @@ -2266,12 +2201,6 @@ AsciiStrDecimalToUintnS ( > be ignored. Then, the function stops at the first character that is = a not 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 = stored > at the location pointed to by Data. > If the number represented by String exceeds the range defined by = UINT64, then > @@ -2382,12 +2311,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 +2432,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 +2552,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 +2651,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. > @@ -2855,7 +2770,6 @@ UnicodeStrnToAsciiStrS ( > 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 > @@ -2948,7 +2862,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 +2985,6 @@ AsciiStrnToUnicodeStrS ( > "::" can be used to compress one or more groups of X when X contains = only 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 = pointer > to the character that stopped the scan is stored at the location = pointed to > by EndPointer. > @@ -3291,10 +3200,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 = pointer > to the character that stopped the scan is stored at the location = pointed to > by EndPointer. > @@ -3448,9 +3353,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 = string. > @param Guid Pointer to the converted GUID. >=20 > @@ -3550,17 +3452,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 = string. > @param Length The number of ASCII characters to = decode. > @param Buffer Pointer to the converted bytes = array. > -- > 2.21.0.windows.1 >=20 -----------------------958ead0e0d4a7ace67eee6ac735f8fa8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wsBmBAEBCAAQBQJexMZ1CRBPsoxt7Hy0xQAKCRBPsoxt7Hy0xQ7WB/0T5IES SXSKVSnpEf1sLxbwBuvK5Ef7GLZUoLCdI+eY+tiGw7y4VKSb5eamGNzImVfi Pxedvmnk9XP5TGOKGyq5PhuU50wiOoIMGuuSWVMDgadJWgIT/oWHC31M9dQD +DYdmRnUpg9FfKbZwbyGY4wcb7knLuLwNpXQl7J5EW83sq+tRo6pYMCsxvoA ZZHqwFXZk+YW3UETWcKfxYhEbAMzNYMSaBz4A8aCdNsbZqZSVKd64O7MFLrP WxDk2cujTZhblCJAMqyOhxTa5/A6QUBbVsGOqJG8WxiuYO8Dzj8vidNgb9+A haaKfVHBQ+ZEfMEvEd+lb1Yn7MROagBRnnPD =1Bph -----END PGP SIGNATURE----- -----------------------958ead0e0d4a7ace67eee6ac735f8fa8--