diff --git a/source/common/http/http1/codec_impl.cc b/source/common/http/http1/codec_impl.cc index 85efa2c111024..05b3b0657a564 100644 --- a/source/common/http/http1/codec_impl.cc +++ b/source/common/http/http1/codec_impl.cc @@ -948,11 +948,12 @@ ClientConnectionImpl::ClientConnectionImpl(Network::Connection& connection, Stat max_response_headers_count, formatter(settings), settings.enable_trailers_) {} bool ClientConnectionImpl::cannotHaveBody() { - if ((pending_response_.has_value() && pending_response_.value().encoder_.headRequest()) || - parser_.status_code == 204 || parser_.status_code == 304 || - (parser_.status_code >= 200 && parser_.content_length == 0)) { + if (pending_response_.has_value() && pending_response_.value().encoder_.headRequest()) { ASSERT(!pending_response_done_); return true; + } else if (parser_.status_code == 204 || parser_.status_code == 304 || + (parser_.status_code >= 200 && parser_.content_length == 0)) { + return true; } else { return false; } diff --git a/test/common/http/codec_impl_corpus/clusterfuzz-testcase-minimized-codec_impl_fuzz_test-5102523695497216 b/test/common/http/codec_impl_corpus/clusterfuzz-testcase-minimized-codec_impl_fuzz_test-5102523695497216 new file mode 100644 index 0000000000000..e23cf3b069a5e --- /dev/null +++ b/test/common/http/codec_impl_corpus/clusterfuzz-testcase-minimized-codec_impl_fuzz_test-5102523695497216 @@ -0,0 +1,35 @@ +actions { + new_stream { + request_headers { + headers { + key: ":method" + value: "GET" + } + headers { + key: ":path" + value: "/" + } + } + } +} +actions { + client_drain { + } +} +actions { + stream_action { + request { + trailers { + } + } + } +} +actions { + stream_action { + response { + headers { + } + end_stream: true + } + } +}