Skip to content

Commit

Permalink
Merge pull request #310 from amirlivneh/fuzz-no-server-uni-stream
Browse files Browse the repository at this point in the history
fuzz_http3serverreq: Don't generate server unidirectional stream ID
  • Loading branch information
tatsuhiro-t authored Jan 6, 2025
2 parents bf76262 + 02280cf commit 0566254
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fuzz/fuzz_http3serverreq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ extern "C" {
#endif // defined(__cplusplus)

#include "nghttp3_macro.h"
#include "nghttp3_stream.h"

#ifdef __cplusplus
}
Expand Down Expand Up @@ -283,6 +284,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
fuzzed_data_provider.ConsumeBool();) {
auto stream_id = fuzzed_data_provider.ConsumeIntegralInRange<int64_t>(
0, NGHTTP3_MAX_VARINT);
if (nghttp3_server_stream_uni(stream_id)) {
goto fin;
}

auto chunk_size = fuzzed_data_provider.ConsumeIntegral<size_t>();
auto chunk = fuzzed_data_provider.ConsumeBytes<uint8_t>(chunk_size);
auto fin = fuzzed_data_provider.ConsumeBool();
Expand Down

0 comments on commit 0566254

Please sign in to comment.