From nobody Thu Mar 28 08:50:16 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+59917+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+59917+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1589944273; cv=none; d=zohomail.com; s=zohoarc; b=i7rNUZNUAQt6sVAnv3F/8LN3bRNMvFJYvzmXlkC9zj1fBajyv/ajQvl4FNLevUVI0Z5VAjPKsBI47MinzwjzySia4sJsLieqSC0xgOPf2u0aTOe87MugNvnCT8gp7KNi5HehuOCEKfBHPsw3Y/L9V/7xPJ4M7rARjBlCLztDn9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589944273; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=AmXI4fdF+dxGAFAcxb3PPlehpOThAC8QwvUE5+sSRw0=; b=GpRwHflRwAq3nGovff50LeYWATCTe3jJAK3dFYs8AlLJoLuEtDjO2yZ9kVzt9iHUQkMLC0Lnul3gHQnbHDHZ0Zzg7bwh/TP/UhTOYwa7r5XZRX8kBRQ20Af3zAkQli32AVy8D4Y526wXxlNpsv6hknuObj528CKwIywUhLop29U= 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+59917+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 1589944273581873.9131271917819; Tue, 19 May 2020 20:11:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Z2iiYY1788612xoQLsB1rXzl; Tue, 19 May 2020 20:11:13 -0700 X-Received: from mga14.intel.com (mga14.intel.com []) by mx.groups.io with SMTP id smtpd.web12.5927.1589944272310874729 for ; Tue, 19 May 2020 20:11:12 -0700 IronPort-SDR: uGh/KtKSy0fuUNmPNLsBUWVgt5lgvgtLh9+980sdix8jPzTf1ya7K+yYp0xtck5XPom/ADEIh9 tAoIX1Q1pynA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 20:11:11 -0700 IronPort-SDR: 46PuKXZ6Mwjt1uc0t5+ViFXhIVY9ntsZBmJo47MUkqjFRvyKDGVU4TAEO8lTgmHEd2NOqQUYJG nRvk1G0uhkrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,412,1583222400"; d="scan'208";a="439858622" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.255.230.104]) by orsmga005.jf.intel.com with ESMTP; 19 May 2020 20:11:11 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Vitaly Cheptsov , Andrew Fish , Ard Biesheuvel , Bret Barkelew , "Brian J . Johnson" , Chasel Chiu , Jordan Justen , Laszlo Ersek , Leif Lindholm , Liming Gao , Marvin H?user , Vincent Zimmer , Zhichao Gao , Jiewen Yao Subject: [edk2-devel] [Patch v8 1/2] MdePkg: Fix SafeString performing assertions on runtime checks Date: Tue, 19 May 2020 20:11:07 -0700 Message-Id: <20200520031108.9644-2-michael.d.kinney@intel.com> In-Reply-To: <20200520031108.9644-1-michael.d.kinney@intel.com> References: <20200520031108.9644-1-michael.d.kinney@intel.com> 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,michael.d.kinney@intel.com X-Gm-Message-State: 8r7G7kVLJ3ASIfOnaKV9MhZQx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589944273; bh=7UYgBb5ZWdNerh2AkAbEg43O8PzpCSXixA0WTUpDQyE=; h=Cc:Date:From:Reply-To:Subject:To; b=SmKH/WbIjyCJCjw3FPViIzqAyDtaYZ45BMma3YwEDimgGnjIt17KHMnoNBOLU8zlJ5h By77ZQ5dE9t0SenJcSAlTTIlg3Q+n+54aGZd5gOu3kGSb3qaxkDMt9QOsOTNXNMcpE1KU G3UTumSjaGEnLmiFz2mmp3xgF61n1ULRxfk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Vitaly Cheptsov 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. Replace ASSERT() with a DEBUG_VERBOSE message. 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 Reviewed-by: Laszlo Ersek --- MdePkg/Include/Library/BaseLib.h | 111 --------------------------- MdePkg/Library/BaseLib/SafeString.c | 115 +--------------------------- 2 files changed, 3 insertions(+), 223 deletions(-) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.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 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 @@ -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 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. @@ -433,12 +424,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. @@ -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 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. @@ -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 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. @@ -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 st= ring. @@ -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 st= ring. @@ -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 st= ring. @@ -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 st= ring. @@ -804,12 +772,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 @@ -859,12 +821,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 @@ -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 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. @@ -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 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. @@ -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 st= ring. @@ -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 st= ring. @param Length The number of Unicode characters to dec= ode. @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 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. @@ -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 point= er 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 stri= ng. @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 stri= ng. @param Length The number of ASCII characters to decod= e. @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/S= afeString.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 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 +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 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 +698,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 +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 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 +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 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. @@ -1091,16 +1069,8 @@ StrHexToUint64S ( "::" 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. @@ -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 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. @@ -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 st= ring. @@ -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 st= ring. @param Length The number of Unicode characters to dec= ode. @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 st= ring. @@ -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 st= ring. @@ -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 st= ring. @@ -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 st= ring. @@ -2154,12 +2095,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 +2201,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 +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 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 +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 point= er 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 stri= ng. @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 stri= ng. @param Length The number of ASCII characters to decod= e. @param Buffer Pointer to the converted bytes array. --=20 2.21.0.windows.1 -=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 (#59917): https://edk2.groups.io/g/devel/message/59917 Mute This Topic: https://groups.io/mt/74342113/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-