Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix protobuf asan failed #312

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions bazel/patches/protobuf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/src/google/protobuf/wire_format.h b/src/google/protobuf/wire_format.h
index 1acbf9e1f..ff2f62282 100644
--- a/src/google/protobuf/wire_format.h
+++ b/src/google/protobuf/wire_format.h
@@ -356,8 +356,9 @@ inline size_t WireFormat::TagSize(int field_number,
inline void WireFormat::VerifyUTF8String(const char* data, int size,
WireFormat::Operation op) {
#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
- WireFormatLite::VerifyUtf8String(
- data, size, static_cast<WireFormatLite::Operation>(op), nullptr);
+ WireFormatLite::VerifyUtf8String(data, size,
+ static_cast<WireFormatLite::Operation>(op),
+ /* field_name = */ "");
#else
// Avoid the compiler warning about unused variables.
(void)data;
2 changes: 2 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def _com_google_protobuf():
sha256 = "2c6a36c7b5a55accae063667ef3c55f2642e67476d96d355ff0acb13dbb47f09",
strip_prefix = "protobuf-21.12",
type = "tar.gz",
patch_args = ["-p1"],
patches = ["@yacl//bazel:patches/protobuf.patch"],
urls = [
"https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protobuf-all-21.12.tar.gz",
],
Expand Down
Loading