Skip to content

Commit

Permalink
fix use-after-free bug
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Sarra <[email protected]>
  • Loading branch information
Leonardo Sarra committed Aug 5, 2024
1 parent 9db18bc commit a16f357
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/common/router/router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,10 @@ Http::FilterHeadersStatus Filter::decodeHeaders(Http::RequestHeaderMap& headers,
(upstream_http_protocol_options.value().auto_sni() ||
upstream_http_protocol_options.value().auto_san_validation())) {
// Default the header to Host/Authority header.
auto header_value = headers.getHostValue();
if (Runtime::runtimeFeatureEnabled(
std::string header_value = route_entry_->getRequestHostValue(headers);
if (!Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.use_route_host_mutation_for_auto_sni")) {
header_value = route_entry_->getRequestHostValue(headers);
header_value = std::string(headers.getHostValue());
}

// Check whether `override_auto_sni_header` is specified.
Expand Down

0 comments on commit a16f357

Please sign in to comment.