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

protobuf: add back ubsan patch #8417

Merged
merged 2 commits into from Sep 27, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions bazel/protobuf.patch
@@ -1,3 +1,23 @@
diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc
index 3844fa6b8b..5486887295 100644
--- a/src/google/protobuf/stubs/strutil.cc
+++ b/src/google/protobuf/stubs/strutil.cc
@@ -1065,10 +1065,12 @@ char* FastUInt32ToBufferLeft(uint32 u, char* buffer) {
}

char* FastInt32ToBufferLeft(int32 i, char* buffer) {
- uint32 u = i;
+ uint32 u = 0;
if (i < 0) {
*buffer++ = '-';
- u = -i;
+ u -= i;
+ } else {
+ u = i;
}
return FastUInt32ToBufferLeft(u, buffer);
}

diff --git a/BUILD b/BUILD
index 6665de94..55f28582 100644
--- a/BUILD
Expand Down
4 changes: 2 additions & 2 deletions bazel/repositories.bzl
Expand Up @@ -506,7 +506,7 @@ def _com_google_protobuf():
# The patch includes
# https://github.com/protocolbuffers/protobuf/pull/6333 and also uses
# foreign_cc build for zlib as its dependency.
# TODO(asraa): remove this when > protobuf 3.8.0 is released.
# TODO(asraa): remove this when protobuf 3.10 is released.
patch_args = ["-p1"],
patches = ["@envoy//bazel:protobuf.patch"],
)
Expand All @@ -520,7 +520,7 @@ def _com_google_protobuf():
# The patch includes
# https://github.com/protocolbuffers/protobuf/pull/6333 and also uses
# foreign_cc build for zlib as its dependency.
# TODO(asraa): remove this when > protobuf 3.8.0 is released.
# TODO(asraa): remove this when protobuf 3.10 is released.
patch_args = ["-p1"],
patches = ["@envoy//bazel:protobuf.patch"],
)
Expand Down
@@ -0,0 +1,11 @@
config {
vhds {
config_source {
api_config_source {
request_timeout {
nanos: -2147483648
}
}
}
}
}