build: Fix msan use-of-unitialized-value in router #8456
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Asra Ali asraa@google.com
Sending an HTTP/1.1 request with an empty host to an Envoy with redirect configured causes a use-of-unitialized-value when processing the request host.
This was caught running msan in google.
Also fixes unneeded
const absl::string_view&
parametersRisk level: Low
05888==WARNING: MemorySanitizer: use-of-uninitialized-value
| #0 0x5622c8c8062a in Envoy::Router::RouteEntryImplBase::processRequestHost(Envoy::Http::HeaderMap const&, absl::string_view const&, absl::string_view const&) const third_party/envoy/src/source/common/router/config_impl.cc:590:7
| #1 0x5622c8c80cb2 in Envoy::Router::RouteEntryImplBase::newPath(Envoy::Http::HeaderMap const&) const third_party/envoy/src/source/common/router/config_impl.cc:646:18
| #2 0x5622c8c81b07 in non-virtual thunk to Envoy::Router::RouteEntryImplBase::newPath(Envoy::Http::HeaderMap const&) const third_party/envoy/src/source/common/router/config_impl.cc
| #3 0x5622c8c61723 in Envoy::Router::Filter::decodeHeaders(Envoy::Http::HeaderMap&, bool)::$_1::operator()(Envoy::Http::HeaderMap&) const third_party/envoy/src/source/common/router/router.cc:366:50
| #4 0x5622c79f8df7 in Envoy::Http::ConnectionManagerImpl::ActiveStream::sendLocalReply(bool, Envoy::Http::Code, absl::string_view, std::__msan::function<void (Envoy::Http::HeaderMap&)> const&, bool, std::__msan::optionalEnvoy::Grpc::Status::GrpcStatus, absl::string_view)::$_5::operator()(std::__msan::unique_ptr<Envoy::Http::HeaderMap, std::__msan::default_deleteEnvoy::Http::HeaderMap >&&, bool) const third_party/envoy/src/source/common/http/conn_manager_impl.cc:1303:11