Skip to content

Commit

Permalink
Fix a MSAN issue in ext_authz due to max_request_bytes_ change (#31897)
Browse files Browse the repository at this point in the history
Signed-off-by: Yanjun Xiang <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
yanjunxiang-google authored and phlax committed Feb 6, 2024
1 parent 9329094 commit 8e07ee4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/extensions/filters/http/ext_authz/ext_authz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,16 @@ Http::FilterHeadersStatus Filter::decodeHeaders(Http::RequestHeaderMap& headers,
!(end_stream || Http::Utility::isWebSocketUpgradeRequest(headers) ||
Http::Utility::isH2UpgradeRequest(headers));

max_request_bytes_ = config_->maxRequestBytes();
if (buffer_data_) {
ENVOY_STREAM_LOG(debug, "ext_authz filter is buffering the request", *decoder_callbacks_);

allow_partial_message_ = check_settings.has_with_request_body()
? check_settings.with_request_body().allow_partial_message()
: config_->allowPartialMessage();
max_request_bytes_ = check_settings.has_with_request_body()
? check_settings.with_request_body().max_request_bytes()
: config_->maxRequestBytes();

if (check_settings.has_with_request_body()) {
max_request_bytes_ = check_settings.with_request_body().max_request_bytes();
}
if (!allow_partial_message_) {
decoder_callbacks_->setDecoderBufferLimit(max_request_bytes_);
}
Expand Down

0 comments on commit 8e07ee4

Please sign in to comment.