aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2025-04-23 22:24:43 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2025-04-23 22:34:46 +0300
commit34daf824d7582c9d9b1253d099f7dcae2e0e6c74 (patch)
treef174a549e379ed9a0e08d29162291cf8eac60602
parent7ef56d1c4b806b4979daf62c4292a82b024fe1fb (diff)
downloadydb-34daf824d7582c9d9b1253d099f7dcae2e0e6c74.tar.gz
Intermediate changes
commit_hash:305fec3efc9087bab26ae2fca809e1c3c0723b00
-rw-r--r--contrib/libs/protobuf-mutator/.yandex_meta/__init__.py20
-rw-r--r--contrib/libs/protobuf-mutator/.yandex_meta/default.nix21
-rw-r--r--contrib/libs/protobuf-mutator/README.md39
-rw-r--r--contrib/libs/protobuf-mutator/patches/support-tstring.patch11
-rw-r--r--contrib/libs/protobuf-mutator/port/protobuf.h79
-rw-r--r--contrib/libs/protobuf-mutator/src/binary_format.cc4
-rw-r--r--contrib/libs/protobuf-mutator/src/field_instance.h8
-rw-r--r--contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.cc2
-rw-r--r--contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.h2
-rw-r--r--contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_mutator.cc17
-rw-r--r--contrib/libs/protobuf-mutator/src/mutator.cc16
-rw-r--r--contrib/libs/protobuf-mutator/src/mutator.h4
-rw-r--r--contrib/libs/protobuf-mutator/src/text_format.cc7
-rw-r--r--contrib/libs/protobuf-mutator/src/utf8_fix.cc2
-rw-r--r--contrib/libs/protobuf-mutator/src/utf8_fix.h2
-rw-r--r--contrib/libs/protobuf-mutator/ya.make6
16 files changed, 199 insertions, 41 deletions
diff --git a/contrib/libs/protobuf-mutator/.yandex_meta/__init__.py b/contrib/libs/protobuf-mutator/.yandex_meta/__init__.py
new file mode 100644
index 00000000000..beef929495f
--- /dev/null
+++ b/contrib/libs/protobuf-mutator/.yandex_meta/__init__.py
@@ -0,0 +1,20 @@
+from devtools.yamaker import fileutil
+from devtools.yamaker.project import CMakeNinjaNixProject
+
+
+def post_install(self):
+ fileutil.re_sub_dir(
+ self.dstdir,
+ r"\bstd::string\b",
+ "TProtoStringType",
+ )
+
+
+protobuf_mutator = CMakeNinjaNixProject(
+ nixattr="protobuf_mutator",
+ arcdir="contrib/libs/protobuf-mutator",
+ owners=["g:cpp-contrib"],
+ addincl_global={".": ["."]},
+ put_with={"protobuf-mutator": ["protobuf-mutator-libfuzzer"]},
+ post_install=post_install,
+)
diff --git a/contrib/libs/protobuf-mutator/.yandex_meta/default.nix b/contrib/libs/protobuf-mutator/.yandex_meta/default.nix
new file mode 100644
index 00000000000..cdbc64e152c
--- /dev/null
+++ b/contrib/libs/protobuf-mutator/.yandex_meta/default.nix
@@ -0,0 +1,21 @@
+self: super: with self; {
+ protobuf_mutator = stdenv.mkDerivation rec {
+ pname = "protobuf_mutator";
+ version = "1.5";
+
+ src = fetchFromGitHub {
+ owner = "google";
+ repo = "libprotobuf-mutator";
+ rev = "v${version}";
+ hash = "sha256-0iohTyYcV76OOaq9zBpQ6FB+ipxlK/fm/4N7Gp8vnwA=";
+ };
+
+ buildInputs = [ pkgs.protobuf ];
+
+ nativeBuildInputs = [ cmake ];
+
+ cmakeFlags = [
+ "-DLIB_PROTO_MUTATOR_TESTING=OFF"
+ ];
+ };
+}
diff --git a/contrib/libs/protobuf-mutator/README.md b/contrib/libs/protobuf-mutator/README.md
index ef780604fbb..e87f96e9e00 100644
--- a/contrib/libs/protobuf-mutator/README.md
+++ b/contrib/libs/protobuf-mutator/README.md
@@ -1,6 +1,6 @@
# libprotobuf-mutator
-[![TravisCI Build Status](https://travis-ci.org/google/libprotobuf-mutator.svg?branch=master)](https://travis-ci.org/google/libprotobuf-mutator)
+[![Build Status](https://github.com/google/libprotobuf-mutator/actions/workflows/cmake-multi-platform.yml/badge.svg?event=push)](https://github.com/google/libprotobuf-mutator/actions/workflows/cmake-multi-platform.yml?query=event%3Apush)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/libprotobuf-mutator.svg)](https://oss-fuzz-build-logs.storage.googleapis.com/index.html#libprotobuf-mutator)
## Overview
@@ -8,11 +8,16 @@ libprotobuf-mutator is a library to randomly mutate
[protobuffers](https://github.com/google/protobuf). <BR>
It could be used together with guided fuzzing engines, such as [libFuzzer](http://libfuzzer.info).
+The core of libprotobuf-mutator has the following dependencies:
+
+- Protobuf >=3.6.1.3 (library and compiler)
+- Clang >=12.0.0 including libFuzzer
+
## Quick start on Debian/Ubuntu
Install prerequisites:
-```
+```sh
sudo apt-get update
sudo apt-get install protobuf-compiler libprotobuf-dev binutils cmake \
ninja-build liblzma-dev libz-dev pkg-config autoconf libtool
@@ -20,7 +25,7 @@ sudo apt-get install protobuf-compiler libprotobuf-dev binutils cmake \
Compile and test everything:
-```
+```sh
mkdir build
cd build
cmake .. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug
@@ -36,7 +41,7 @@ build a working version of protobuf.
Installation:
-```
+```sh
ninja
sudo ninja install
```
@@ -59,7 +64,7 @@ using [libFuzzer](http://libfuzzer.info)'s mutators.
To apply one mutation to a protobuf object do the following:
-```
+```c++
class MyProtobufMutator : public protobuf_mutator::Mutator {
public:
// Optionally redefine the Mutate* methods to perform more sophisticated mutations.
@@ -77,7 +82,7 @@ See also the `ProtobufMutatorMessagesTest.UsageExample` test from
## Integrating with libFuzzer
LibFuzzerProtobufMutator can help to integrate with libFuzzer. For example
-```
+```c++
#include "src/libfuzzer/libfuzzer_macro.h"
DEFINE_PROTO_FUZZER(const MyMessageType& input) {
@@ -97,7 +102,7 @@ for fuzzer even if it's capable of inserting acceptable values with time.
PostProcessorRegistration can be used to avoid such issue and guide your fuzzer towards interesting
code. It registers callback which will be called for each message of particular type after each mutation.
-```
+```c++
static protobuf_mutator::libfuzzer::PostProcessorRegistration<MyMessageType> reg = {
[](MyMessageType* message, unsigned int seed) {
TweakMyMessage(message, seed);
@@ -117,7 +122,7 @@ may corrupt the reproducer so it stops triggering the bug.
Note: You can add callback for any nested message and you can add multiple callbacks for
the same message type.
-```
+```c++
static PostProcessorRegistration<MyMessageType> reg1 = {
[](MyMessageType* message, unsigned int seed) {
TweakMyMessage(message, seed);
@@ -155,6 +160,24 @@ cleanup/initialize the message as workaround.
* [Envoy](https://github.com/envoyproxy/envoy/search?q=DEFINE_TEXT_PROTO_FUZZER+OR+DEFINE_PROTO_FUZZER+OR+DEFINE_BINARY_PROTO_FUZZER&unscoped_q=DEFINE_TEXT_PROTO_FUZZER+OR+DEFINE_PROTO_FUZZER+OR+DEFINE_BINARY_PROTO_FUZZER&type=Code)
* [LLVM](https://github.com/llvm-mirror/clang/search?q=DEFINE_TEXT_PROTO_FUZZER+OR+DEFINE_PROTO_FUZZER+OR+DEFINE_BINARY_PROTO_FUZZER&unscoped_q=DEFINE_TEXT_PROTO_FUZZER+OR+DEFINE_PROTO_FUZZER+OR+DEFINE_BINARY_PROTO_FUZZER&type=Code)
+## Grammars
+* GIF, https://github.com/google/oss-fuzz/tree/master/projects/giflib
+* JSON
+ * https://github.com/google/oss-fuzz/tree/master/projects/jsoncpp
+ * https://github.com/officialcjunior/fuzzrtos/tree/c72e6670e566672ccf8023265cbfad616e75790d/protobufv2
+* Lua 5.1 Language,
+ * https://github.com/ligurio/lua-c-api-tests/tree/master/tests/luaL_loadbuffer_proto
+ * https://github.com/Spoookyyy/luaj/tree/main/fuzz
+* PNG, https://github.com/google/oss-fuzz/tree/master/projects/libpng-proto
+* SQL
+ * https://github.com/tarantool/tarantool/tree/master/test/fuzz/sql_fuzzer
+ * https://chromium.googlesource.com/chromium/src/third_party/+/refs/heads/main/sqlite/fuzz
+* Solidity Language, https://github.com/ethereum/solidity/tree/develop/test/tools/ossfuzz
+* XML
+ * https://github.com/google/oss-fuzz/tree/master/projects/xerces-c
+ * https://github.com/google/libprotobuf-mutator/tree/master/examples/xml
+* JPEG, https://source.chromium.org/chromium/chromium/src/+/main:media/gpu/vaapi/fuzzers/jpeg_decoder/
+
## Bugs found with help of the library
### Chromium
diff --git a/contrib/libs/protobuf-mutator/patches/support-tstring.patch b/contrib/libs/protobuf-mutator/patches/support-tstring.patch
new file mode 100644
index 00000000000..8324791d76f
--- /dev/null
+++ b/contrib/libs/protobuf-mutator/patches/support-tstring.patch
@@ -0,0 +1,11 @@
+--- a/src/utf8_fix.h
++++ b/src/utf8_fix.h
+@@ -17,6 +17,8 @@
+
+ #include <string>
+
++#include <google/protobuf/stubs/port.h>
++
+ #include "src/random.h"
+
+ namespace protobuf_mutator {
diff --git a/contrib/libs/protobuf-mutator/port/protobuf.h b/contrib/libs/protobuf-mutator/port/protobuf.h
index c13d1017d1a..4fd7d74344f 100644
--- a/contrib/libs/protobuf-mutator/port/protobuf.h
+++ b/contrib/libs/protobuf-mutator/port/protobuf.h
@@ -20,16 +20,91 @@
#include "google/protobuf/any.pb.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/message.h"
+#include "google/protobuf/stubs/common.h" // for GOOGLE_PROTOBUF_VERSION
#include "google/protobuf/text_format.h"
#include "google/protobuf/util/message_differencer.h"
#include "google/protobuf/wire_format.h"
+namespace google {
+namespace protobuf {
+#if GOOGLE_PROTOBUF_VERSION < 4025000
+
+template <typename T>
+const T* DownCastMessage(const Message* message) {
+ return static_cast<const T*>(message);
+}
+
+template <typename T>
+T* DownCastMessage(Message* message) {
+ const Message* message_const = message;
+ return const_cast<T*>(DownCastMessage<T>(message_const));
+}
+
+#elif GOOGLE_PROTOBUF_VERSION < 5029000
+
+template <typename T>
+const T* DownCastMessage(const Message* message) {
+ return DownCastToGenerated<T>(message);
+}
+
+template <typename T>
+T* DownCastMessage(Message* message) {
+ return DownCastToGenerated<T>(message);
+}
+
+#endif // GOOGLE_PROTOBUF_VERSION
+} // namespace protobuf
+} // namespace google
+
namespace protobuf_mutator {
namespace protobuf = google::protobuf;
-// String type used by google::protobuf.
-using String = TProtoStringType;
+inline bool RequiresUtf8Validation(
+ const google::protobuf::FieldDescriptor& descriptor) {
+ // commit d85c9944c55fb38f4eae149979a0f680ea125ecb of >= v3(!).22.0
+#if GOOGLE_PROTOBUF_VERSION >= 4022000
+ return descriptor.requires_utf8_validation();
+#else
+ return descriptor.type() == google::protobuf::FieldDescriptor::TYPE_STRING &&
+ descriptor.file()->syntax() ==
+ google::protobuf::FileDescriptor::SYNTAX_PROTO3;
+#endif
+}
+
+inline bool HasPresence(const google::protobuf::FieldDescriptor& descriptor) {
+ // commit bb30225f06c36399757dc698b409d5f79738e8d1 of >=3.12.0
+#if GOOGLE_PROTOBUF_VERSION >= 3012000
+ return descriptor.has_presence();
+#else
+ // NOTE: This mimics Protobuf 3.21.12 ("3021012")
+ return !descriptor.is_repeated() &&
+ (descriptor.cpp_type() ==
+ google::protobuf::FieldDescriptor::CppType::CPPTYPE_MESSAGE ||
+ descriptor.containing_oneof() ||
+ descriptor.file()->syntax() ==
+ google::protobuf::FileDescriptor::SYNTAX_PROTO2);
+#endif
+}
+
+inline void PrepareTextParser(google::protobuf::TextFormat::Parser& parser) {
+ // commit d8c2501b43c1b56e3efa74048a18f8ce06ba07fe of >=3.8.0 for .SetRecursionLimit
+ // commit 176f7db11d8242b36a3ea6abb1cc436fca5bf75d of >=3.8.0 for .AllowUnknownField
+#if GOOGLE_PROTOBUF_VERSION >= 3008000
+ parser.SetRecursionLimit(100);
+ parser.AllowUnknownField(true);
+#endif
+}
+
+constexpr bool TextParserCanSetRecursionLimit() {
+ // commit d8c2501b43c1b56e3efa74048a18f8ce06ba07fe of >=3.8.0
+ return GOOGLE_PROTOBUF_VERSION >= 3008000;
+}
+
+constexpr bool TextParserCanAllowUnknownField() {
+ // commit 176f7db11d8242b36a3ea6abb1cc436fca5bf75d of >=3.8.0
+ return GOOGLE_PROTOBUF_VERSION >= 3008000;
+}
} // namespace protobuf_mutator
diff --git a/contrib/libs/protobuf-mutator/src/binary_format.cc b/contrib/libs/protobuf-mutator/src/binary_format.cc
index 33ec77dba36..49008c6d933 100644
--- a/contrib/libs/protobuf-mutator/src/binary_format.cc
+++ b/contrib/libs/protobuf-mutator/src/binary_format.cc
@@ -43,8 +43,8 @@ size_t SaveMessageAsBinary(const Message& message, uint8_t* data,
}
TProtoStringType SaveMessageAsBinary(const protobuf::Message& message) {
- String tmp;
- if (!message.SerializePartialToString(&tmp)) return {};
+ TProtoStringType tmp;
+ if (!message.SerializePartialToString(&tmp)) tmp.clear();
return tmp;
}
diff --git a/contrib/libs/protobuf-mutator/src/field_instance.h b/contrib/libs/protobuf-mutator/src/field_instance.h
index 11ab465e8a2..e2f64826900 100644
--- a/contrib/libs/protobuf-mutator/src/field_instance.h
+++ b/contrib/libs/protobuf-mutator/src/field_instance.h
@@ -176,7 +176,7 @@ class ConstFieldInstance {
WireFormatLite::PARSE, "");
}
- TProtoStringType name() const { return descriptor_->name(); }
+ TProtoStringType name() const { return TProtoStringType(descriptor_->name()); }
protobuf::FieldDescriptor::CppType cpp_type() const {
return descriptor_->cpp_type();
@@ -190,11 +190,7 @@ class ConstFieldInstance {
return descriptor_->message_type();
}
- bool EnforceUtf8() const {
- return descriptor_->type() == protobuf::FieldDescriptor::TYPE_STRING &&
- descriptor()->file()->syntax() ==
- protobuf::FileDescriptor::SYNTAX_PROTO3;
- }
+ bool EnforceUtf8() const { return RequiresUtf8Validation(*descriptor_); }
const protobuf::FieldDescriptor* descriptor() const { return descriptor_; }
diff --git a/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.cc b/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.cc
index 4e506cbe947..2004df62ef1 100644
--- a/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.cc
+++ b/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.cc
@@ -235,7 +235,7 @@ void RegisterPostProcessor(
const protobuf::Descriptor* desc,
std::function<void(protobuf::Message* message, unsigned int seed)>
callback) {
- GetMutator()->RegisterPostProcessor(desc, callback);
+ GetMutator()->RegisterPostProcessor(desc, std::move(callback));
}
} // namespace libfuzzer
diff --git a/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.h b/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.h
index b5cb201810b..8907326586b 100644
--- a/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.h
+++ b/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.h
@@ -119,7 +119,7 @@ struct PostProcessorRegistration {
RegisterPostProcessor(
Proto::descriptor(),
[callback](protobuf::Message* message, unsigned int seed) {
- callback(static_cast<Proto*>(message), seed);
+ callback(protobuf::DownCastMessage<Proto>(message), seed);
});
}
};
diff --git a/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_mutator.cc b/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_mutator.cc
index 9c3be921e69..cacc83191af 100644
--- a/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_mutator.cc
+++ b/contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_mutator.cc
@@ -14,6 +14,11 @@
#include "src/libfuzzer/libfuzzer_mutator.h"
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+#include <sanitizer/msan_interface.h>
+#endif
+#endif
#include <string.h>
#include <algorithm>
@@ -65,6 +70,12 @@ T MutateValue(T v) {
size_t size =
LLVMFuzzerMutate(reinterpret_cast<uint8_t*>(&v), sizeof(v), sizeof(v));
memset(reinterpret_cast<uint8_t*>(&v) + size, 0, sizeof(v) - size);
+ // The value from LLVMFuzzerMutate needs to be treated as initialized.
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+ __msan_unpoison(&v, sizeof(v));
+#endif
+#endif
return v;
}
@@ -93,6 +104,12 @@ TProtoStringType Mutator::MutateString(const TProtoStringType& value,
result.resize(std::max(1, new_size));
result.resize(LLVMFuzzerMutate(reinterpret_cast<uint8_t*>(&result[0]),
value.size(), result.size()));
+ // The value from LLVMFuzzerMutate needs to be treated as initialized.
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+ __msan_unpoison(&result[0], result.size());
+#endif
+#endif
return result;
}
diff --git a/contrib/libs/protobuf-mutator/src/mutator.cc b/contrib/libs/protobuf-mutator/src/mutator.cc
index 98f443e3016..c22e871cac5 100644
--- a/contrib/libs/protobuf-mutator/src/mutator.cc
+++ b/contrib/libs/protobuf-mutator/src/mutator.cc
@@ -87,11 +87,7 @@ bool GetRandomBool(RandomEngine* random, size_t n = 2) {
}
bool IsProto3SimpleField(const FieldDescriptor& field) {
- assert(field.file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ||
- field.file()->syntax() == FileDescriptor::SYNTAX_PROTO2);
- return field.file()->syntax() == FileDescriptor::SYNTAX_PROTO3 &&
- field.cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE &&
- !field.containing_oneof() && !field.is_repeated();
+ return !field.is_repeated() && !HasPresence(field);
}
struct CreateDefaultField : public FieldFunction<CreateDefaultField> {
@@ -384,14 +380,14 @@ std::unique_ptr<Message> UnpackAny(const Any& any) {
}
const Any* CastToAny(const Message* message) {
- return Any::GetDescriptor() == message->GetDescriptor()
- ? static_cast<const Any*>(message)
+ return Any::descriptor() == message->GetDescriptor()
+ ? protobuf::DownCastMessage<Any>(message)
: nullptr;
}
Any* CastToAny(Message* message) {
- return Any::GetDescriptor() == message->GetDescriptor()
- ? static_cast<Any*>(message)
+ return Any::descriptor() == message->GetDescriptor()
+ ? protobuf::DownCastMessage<Any>(message)
: nullptr;
}
@@ -486,7 +482,7 @@ class PostProcessing {
Run(It->second.get(), max_depth);
TProtoStringType value;
It->second->SerializePartialToString(&value);
- *any->mutable_value() = value;
+ *any->mutable_value() = std::move(value);
}
}
}
diff --git a/contrib/libs/protobuf-mutator/src/mutator.h b/contrib/libs/protobuf-mutator/src/mutator.h
index 2f1d3a833c4..5b75fa12bf2 100644
--- a/contrib/libs/protobuf-mutator/src/mutator.h
+++ b/contrib/libs/protobuf-mutator/src/mutator.h
@@ -32,7 +32,8 @@ namespace protobuf_mutator {
// Randomly makes incremental change in the given protobuf.
// Usage example:
-// protobuf_mutator::Mutator mutator(1);
+// protobuf_mutator::Mutator mutator;
+// mutator.Seed(1);
// MyMessage message;
// message.ParseFromString(encoded_message);
// mutator.Mutate(&message, 10000);
@@ -44,7 +45,6 @@ namespace protobuf_mutator {
// library like libFuzzer.
class Mutator {
public:
- // seed: value to initialize random number generator.
Mutator() = default;
virtual ~Mutator() = default;
diff --git a/contrib/libs/protobuf-mutator/src/text_format.cc b/contrib/libs/protobuf-mutator/src/text_format.cc
index d8a8342b19c..2ac7ae3a58e 100644
--- a/contrib/libs/protobuf-mutator/src/text_format.cc
+++ b/contrib/libs/protobuf-mutator/src/text_format.cc
@@ -28,9 +28,8 @@ bool ParseTextMessage(const uint8_t* data, size_t size, Message* output) {
bool ParseTextMessage(const TProtoStringType& data, protobuf::Message* output) {
output->Clear();
TextFormat::Parser parser;
- parser.SetRecursionLimit(100);
parser.AllowPartialMessage(true);
- parser.AllowUnknownField(true);
+ PrepareTextParser(parser);
if (!parser.ParseFromString(data, output)) {
output->Clear();
return false;
@@ -49,8 +48,8 @@ size_t SaveMessageAsText(const Message& message, uint8_t* data,
}
TProtoStringType SaveMessageAsText(const protobuf::Message& message) {
- String tmp;
- if (!protobuf::TextFormat::PrintToString(message, &tmp)) return {};
+ TProtoStringType tmp;
+ if (!protobuf::TextFormat::PrintToString(message, &tmp)) tmp.clear();
return tmp;
}
diff --git a/contrib/libs/protobuf-mutator/src/utf8_fix.cc b/contrib/libs/protobuf-mutator/src/utf8_fix.cc
index 845de1cdd37..5e8af4e3b22 100644
--- a/contrib/libs/protobuf-mutator/src/utf8_fix.cc
+++ b/contrib/libs/protobuf-mutator/src/utf8_fix.cc
@@ -14,7 +14,7 @@
#include "src/utf8_fix.h"
-#include <google/protobuf/stubs/port.h>
+#include <stdint.h>
#include <algorithm>
#include <cassert>
diff --git a/contrib/libs/protobuf-mutator/src/utf8_fix.h b/contrib/libs/protobuf-mutator/src/utf8_fix.h
index 8ec7e44285c..dd38b685215 100644
--- a/contrib/libs/protobuf-mutator/src/utf8_fix.h
+++ b/contrib/libs/protobuf-mutator/src/utf8_fix.h
@@ -17,7 +17,7 @@
#include <string>
-#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/port.h>
#include "src/random.h"
diff --git a/contrib/libs/protobuf-mutator/ya.make b/contrib/libs/protobuf-mutator/ya.make
index e7f5abf770c..09776c35072 100644
--- a/contrib/libs/protobuf-mutator/ya.make
+++ b/contrib/libs/protobuf-mutator/ya.make
@@ -1,4 +1,4 @@
-# Generated by devtools/yamaker from nixpkgs 22.05.
+# Generated by devtools/yamaker from nixpkgs 22.11.
LIBRARY()
@@ -6,9 +6,9 @@ LICENSE(Apache-2.0)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(1.1)
+VERSION(1.5)
-ORIGINAL_SOURCE(https://github.com/google/libprotobuf-mutator/archive/v1.1.tar.gz)
+ORIGINAL_SOURCE(https://github.com/google/libprotobuf-mutator/archive/v1.5.tar.gz)
PEERDIR(
contrib/libs/protobuf