diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2024-04-10 11:36:11 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2024-04-10 11:48:43 +0300 |
commit | aad444d84b2ade0084c1c83079c33ed24edb36f8 (patch) | |
tree | 936fc19ec5dc50ae32c46743e96e35f5804a7f9e | |
parent | ce49046255d74900ee2f807a2c421f52c50ee7f1 (diff) | |
download | ydb-aad444d84b2ade0084c1c83079c33ed24edb36f8.tar.gz |
Update contrib/restricted/abseil-cpp to 20240116.2
28e28ecedcb1a34c53d9705068794258e5baa2b9
9 files changed, 46 insertions, 29 deletions
diff --git a/contrib/restricted/abseil-cpp/absl/algorithm/ya.make b/contrib/restricted/abseil-cpp/absl/algorithm/ya.make index 939d073731..ac5695f072 100644 --- a/contrib/restricted/abseil-cpp/absl/algorithm/ya.make +++ b/contrib/restricted/abseil-cpp/absl/algorithm/ya.make @@ -6,9 +6,9 @@ LICENSE(Apache-2.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(20240116.1) +VERSION(20240116.2) -ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz) +ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz) NO_RUNTIME() diff --git a/contrib/restricted/abseil-cpp/absl/base/config.h b/contrib/restricted/abseil-cpp/absl/base/config.h index 436b98048b..cbd9eac58e 100644 --- a/contrib/restricted/abseil-cpp/absl/base/config.h +++ b/contrib/restricted/abseil-cpp/absl/base/config.h @@ -118,7 +118,7 @@ // LTS releases can be obtained from // https://github.com/abseil/abseil-cpp/releases. #define ABSL_LTS_RELEASE_VERSION 20240116 -#define ABSL_LTS_RELEASE_PATCH_LEVEL 1 +#define ABSL_LTS_RELEASE_PATCH_LEVEL 2 // Helper macro to convert a CPP variable to a string literal. #define ABSL_INTERNAL_DO_TOKEN_STR(x) #x diff --git a/contrib/restricted/abseil-cpp/absl/functional/ya.make b/contrib/restricted/abseil-cpp/absl/functional/ya.make index 939d073731..ac5695f072 100644 --- a/contrib/restricted/abseil-cpp/absl/functional/ya.make +++ b/contrib/restricted/abseil-cpp/absl/functional/ya.make @@ -6,9 +6,9 @@ LICENSE(Apache-2.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(20240116.1) +VERSION(20240116.2) -ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz) +ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz) NO_RUNTIME() diff --git a/contrib/restricted/abseil-cpp/absl/memory/ya.make b/contrib/restricted/abseil-cpp/absl/memory/ya.make index f3510dc19e..bdd57c2b35 100644 --- a/contrib/restricted/abseil-cpp/absl/memory/ya.make +++ b/contrib/restricted/abseil-cpp/absl/memory/ya.make @@ -6,9 +6,9 @@ LICENSE(Apache-2.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(20240116.1) +VERSION(20240116.2) -ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz) +ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz) PEERDIR( contrib/restricted/abseil-cpp/absl/meta diff --git a/contrib/restricted/abseil-cpp/absl/meta/ya.make b/contrib/restricted/abseil-cpp/absl/meta/ya.make index 956cefbe8b..9d5d65c475 100644 --- a/contrib/restricted/abseil-cpp/absl/meta/ya.make +++ b/contrib/restricted/abseil-cpp/absl/meta/ya.make @@ -6,9 +6,9 @@ LICENSE(Apache-2.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(20240116.1) +VERSION(20240116.2) -ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz) +ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz) PEERDIR( contrib/restricted/abseil-cpp/absl/base diff --git a/contrib/restricted/abseil-cpp/absl/strings/escaping.cc b/contrib/restricted/abseil-cpp/absl/strings/escaping.cc index 1c0eac42d7..27d3d98c28 100644 --- a/contrib/restricted/abseil-cpp/absl/strings/escaping.cc +++ b/contrib/restricted/abseil-cpp/absl/strings/escaping.cc @@ -362,7 +362,7 @@ std::string CEscapeInternal(absl::string_view src, bool use_hex, } /* clang-format off */ -constexpr unsigned char c_escaped_len[256] = { +constexpr unsigned char kCEscapedLen[256] = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 2, 4, 4, // \t, \n, \r 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // ", ' @@ -387,8 +387,23 @@ constexpr unsigned char c_escaped_len[256] = { // that UTF-8 bytes are not handled specially. inline size_t CEscapedLength(absl::string_view src) { size_t escaped_len = 0; - for (char c : src) - escaped_len += c_escaped_len[static_cast<unsigned char>(c)]; + // The maximum value of kCEscapedLen[x] is 4, so we can escape any string of + // length size_t_max/4 without checking for overflow. + size_t unchecked_limit = + std::min<size_t>(src.size(), std::numeric_limits<size_t>::max() / 4); + size_t i = 0; + while (i < unchecked_limit) { + // Common case: No need to check for overflow. + escaped_len += kCEscapedLen[static_cast<unsigned char>(src[i++])]; + } + while (i < src.size()) { + // Beyond unchecked_limit we need to check for overflow before adding. + size_t char_len = kCEscapedLen[static_cast<unsigned char>(src[i++])]; + ABSL_INTERNAL_CHECK( + escaped_len <= std::numeric_limits<size_t>::max() - char_len, + "escaped_len overflow"); + escaped_len += char_len; + } return escaped_len; } @@ -400,12 +415,15 @@ void CEscapeAndAppendInternal(absl::string_view src, std::string* dest) { } size_t cur_dest_len = dest->size(); + ABSL_INTERNAL_CHECK( + cur_dest_len <= std::numeric_limits<size_t>::max() - escaped_len, + "std::string size overflow"); strings_internal::STLStringResizeUninitialized(dest, cur_dest_len + escaped_len); char* append_ptr = &(*dest)[cur_dest_len]; for (char c : src) { - size_t char_len = c_escaped_len[static_cast<unsigned char>(c)]; + size_t char_len = kCEscapedLen[static_cast<unsigned char>(c)]; if (char_len == 1) { *append_ptr++ = c; } else if (char_len == 2) { diff --git a/contrib/restricted/abseil-cpp/absl/strings/str_cat.h b/contrib/restricted/abseil-cpp/absl/strings/str_cat.h index ea2c4dcad8..1b52a36f4c 100644 --- a/contrib/restricted/abseil-cpp/absl/strings/str_cat.h +++ b/contrib/restricted/abseil-cpp/absl/strings/str_cat.h @@ -601,18 +601,17 @@ StrAppend(absl::Nonnull<String*> str, T... args) { ptrdiff_t n; // The length of the current argument typename String::pointer pos = &(*str)[old_size]; using SomeTrivialEmptyType = std::false_type; - // Ugly code due to the lack of C++14 fold expression makes us. - const SomeTrivialEmptyType dummy1; - for (const SomeTrivialEmptyType& dummy2 : - {(/* Comma expressions are poor man's C++17 fold expression for C++14 */ - (void)(n = lengths[i]), - (void)(n < 0 ? (void)(*pos++ = '-'), (n = ~n) : 0), - (void)absl::numbers_internal::FastIntToBufferBackward( - absl::numbers_internal::UnsignedAbsoluteValue(std::move(args)), - pos += n, static_cast<uint32_t>(n)), - (void)++i, dummy1)...}) { - (void)dummy2; // Remove & migrate to fold expressions in C++17 - } + const SomeTrivialEmptyType dummy; + // Ugly code due to the lack of C++17 fold expressions + const SomeTrivialEmptyType dummies[] = { + (/* Comma expressions are poor man's C++17 fold expression for C++14 */ + (void)(n = lengths[i]), + (void)(n < 0 ? (void)(*pos++ = '-'), (n = ~n) : 0), + (void)absl::numbers_internal::FastIntToBufferBackward( + absl::numbers_internal::UnsignedAbsoluteValue(std::move(args)), + pos += n, static_cast<uint32_t>(n)), + (void)++i, dummy)...}; + (void)dummies; // Remove & migrate to fold expressions in C++17 } // Helper function for the future StrCat default floating-point format, %.6g diff --git a/contrib/restricted/abseil-cpp/absl/utility/ya.make b/contrib/restricted/abseil-cpp/absl/utility/ya.make index 939d073731..ac5695f072 100644 --- a/contrib/restricted/abseil-cpp/absl/utility/ya.make +++ b/contrib/restricted/abseil-cpp/absl/utility/ya.make @@ -6,9 +6,9 @@ LICENSE(Apache-2.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(20240116.1) +VERSION(20240116.2) -ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz) +ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz) NO_RUNTIME() diff --git a/contrib/restricted/abseil-cpp/ya.make b/contrib/restricted/abseil-cpp/ya.make index 486a428c77..384f80ac5f 100644 --- a/contrib/restricted/abseil-cpp/ya.make +++ b/contrib/restricted/abseil-cpp/ya.make @@ -6,9 +6,9 @@ LICENSE(Apache-2.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(20240116.1) +VERSION(20240116.2) -ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz) +ORIGINAL_SOURCE(https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz) PEERDIR( contrib/restricted/abseil-cpp/absl/algorithm |