Skip to content

Commit

Permalink
fix hcm fuzz test case (#37901)
Browse files Browse the repository at this point in the history
Commit Message: fix hcm fuzz test case
Additional Description:

This PR fixes a fuzzer issue caused by the fuzzer sending trailers to
the HCM then calling continueDecoding (which then hits [this
assertion](https://github.com/search?q=repo%3Aenvoyproxy%2Fenvoy%20ASSERT(!state_.decoder_filter_chain_complete_)%3B&type=code)
in the HCM and fails). This PR adds a check to prevent this from
happening.

Risk Level: none, test only
Testing: fuzz fix
Docs Changes: none
Release Notes: none
Platform Specific Features: none

Signed-off-by: antoniovleonti <[email protected]>
  • Loading branch information
antoniovleonti authored Jan 6, 2025
1 parent 5ccb21d commit 29428f9
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
65 changes: 65 additions & 0 deletions test/common/http/conn_manager_impl_corpus/maybe_end_decode

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/common/http/conn_manager_impl_fuzz_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ class FuzzStream {
break;
}
case test::common::http::RequestAction::kContinueDecoding: {
if (!decoding_done_ &&
if (!decoding_done_ && state != StreamState::Closed &&
(header_status_ == FilterHeadersStatus::StopAllIterationAndBuffer ||
header_status_ == FilterHeadersStatus::StopAllIterationAndWatermark ||
header_status_ == FilterHeadersStatus::StopIteration) &&
Expand Down

0 comments on commit 29428f9

Please sign in to comment.