diff --git a/test/common/http/http2/codec_impl_corpus/clusterfuzz-testcase-minimized-codec_impl_fuzz_test-5728207897624576 b/test/common/http/http2/codec_impl_corpus/clusterfuzz-testcase-minimized-codec_impl_fuzz_test-5728207897624576 new file mode 100644 index 000000000000..30ada91a1a8a --- /dev/null +++ b/test/common/http/http2/codec_impl_corpus/clusterfuzz-testcase-minimized-codec_impl_fuzz_test-5728207897624576 @@ -0,0 +1 @@ +actions { new_stream { request_headers { headers { key: " " value: " " } headers { value: "�" } headers { key: ":method" value: "GET" } } } } actions { mutate { buffer: 2 offset: 2 value: 2 } } actions { quiesce_drain { } } diff --git a/test/common/http/http2/codec_impl_fuzz_test.cc b/test/common/http/http2/codec_impl_fuzz_test.cc index 0e0b6f9952dc..d17b111dfc60 100644 --- a/test/common/http/http2/codec_impl_fuzz_test.cc +++ b/test/common/http/http2/codec_impl_fuzz_test.cc @@ -273,9 +273,14 @@ DEFINE_PROTO_FUZZER(const test::common::http::http2::CodecImplFuzzTestCase& inpu // the response encoder and can complete Stream initialization. std::list pending_streams; std::list streams; + // For new streams when we aren't expecting one (e.g. as a result of a mutation). + NiceMock orphan_request_decoder; ON_CALL(server_callbacks, newStream(_)) .WillByDefault(Invoke([&](StreamEncoder& encoder) -> StreamDecoder& { + if (pending_streams.empty()) { + return orphan_request_decoder; + } auto stream_ptr = pending_streams.front()->removeFromList(pending_streams); Stream* const stream = stream_ptr.get(); stream_ptr->moveIntoListBack(std::move(stream_ptr), streams);