diff options
author | vadim-xd <vadim-xd@yandex-team.com> | 2024-10-29 23:26:02 +0300 |
---|---|---|
committer | vadim-xd <vadim-xd@yandex-team.com> | 2024-10-29 23:37:18 +0300 |
commit | c0831b65c047f0894f63562b9da3024dfa779baf (patch) | |
tree | 81aded4973d6396774de89e8c5bc0796307628d5 /contrib/libs/protobuf/patches/fix-string-from-nullptr.patch | |
parent | fa653f89746744964114f44dce53c0f6ffb6deba (diff) | |
download | ydb-c0831b65c047f0894f63562b9da3024dfa779baf.tar.gz |
[protobuf] Restore methods with std::string_view
commit_hash:abb56697e948fac46777acec62a62b40767ea74d
Diffstat (limited to 'contrib/libs/protobuf/patches/fix-string-from-nullptr.patch')
-rw-r--r-- | contrib/libs/protobuf/patches/fix-string-from-nullptr.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/libs/protobuf/patches/fix-string-from-nullptr.patch b/contrib/libs/protobuf/patches/fix-string-from-nullptr.patch new file mode 100644 index 0000000000..27c1110066 --- /dev/null +++ b/contrib/libs/protobuf/patches/fix-string-from-nullptr.patch @@ -0,0 +1,19 @@ +commit 556f12d15e9e59a132af2d4605b7444c4e3b623e (wip) +author: vadim-xd +date: 2024-09-09T01:14:56+03:00 + + Fix ArenaStringPtr::Set(nullptr). + + TString(nullptr) is allowed (at least currently), string_view(nullptr) is UB. + +--- contrib/libs/protobuf/src/google/protobuf/arenastring.h (bff10d7f3e550777570ff58e01b9ae291d02490e) ++++ contrib/libs/protobuf/src/google/protobuf/arenastring.h (556f12d15e9e59a132af2d4605b7444c4e3b623e) +@@ -424,7 +424,7 @@ inline void ArenaStringPtr::InitAllocated(TProtoStringType* str, Arena* arena) { + } + + inline void ArenaStringPtr::Set(const char* s, Arena* arena) { +- Set(absl::string_view{s}, arena); ++ Set(TProtoStringType{s}, arena); + } + + inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) { |