summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-contrib <[email protected]>2024-04-10 11:36:11 +0300
committerrobot-contrib <[email protected]>2024-04-10 11:52:49 +0300
commit1ef9ef51901357fdbd0144a532d8ba9cac13b6ba (patch)
tree43e9e7c9a660e3aba62370264050649e7900c8b2
parentaad444d84b2ade0084c1c83079c33ed24edb36f8 (diff)
Update contrib/restricted/abseil-cpp-tstring to 20240116.2
b9bec68338edf6d889e826f149efea190e76ac4a
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/ya.make4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h2
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/functional/ya.make4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/memory/ya.make4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/meta/ya.make4
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc26
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/utility/ya.make4
7 files changed, 33 insertions, 15 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/ya.make
index 939d0737310..ac5695f0720 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/algorithm/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_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-tstring/y_absl/base/config.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h
index ad8b509e7e1..22bbf3c0b59 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h
@@ -118,7 +118,7 @@
// LTS releases can be obtained from
// https://github.com/abseil/abseil-cpp/releases.
#define Y_ABSL_LTS_RELEASE_VERSION 20240116
-#define Y_ABSL_LTS_RELEASE_PATCH_LEVEL 1
+#define Y_ABSL_LTS_RELEASE_PATCH_LEVEL 2
// Helper macro to convert a CPP variable to a string literal.
#define Y_ABSL_INTERNAL_DO_TOKEN_STR(x) #x
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/functional/ya.make
index 939d0737310..ac5695f0720 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/functional/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_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-tstring/y_absl/memory/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/memory/ya.make
index 9599f83eeb2..d1894c43e59 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/memory/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_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-tstring/y_absl/meta
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/meta/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/meta/ya.make
index 3c9373d1efc..1b4070658f8 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/meta/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_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-tstring/y_absl/base
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc
index 28fa5ad9695..78a706a1bee 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/escaping.cc
@@ -362,7 +362,7 @@ TString CEscapeInternal(y_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(y_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++])];
+ Y_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(y_absl::string_view src, TString* dest) {
}
size_t cur_dest_len = dest->size();
+ Y_ABSL_INTERNAL_CHECK(
+ cur_dest_len <= std::numeric_limits<size_t>::max() - escaped_len,
+ "TString 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-tstring/y_absl/utility/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/utility/ya.make
index 939d0737310..ac5695f0720 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/utility/ya.make
+++ b/contrib/restricted/abseil-cpp-tstring/y_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()