-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fuzz settings in fuzz_http3serverreq #289
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,16 @@ | |
|
||
#include <nghttp3/nghttp3.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif // defined(__cplusplus) | ||
|
||
#include "nghttp3_macro.h" | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif // defined(__cplusplus) | ||
|
||
static int send_data(nghttp3_conn *conn) { | ||
std::array<nghttp3_vec, 16> vec; | ||
int64_t stream_id; | ||
|
@@ -35,9 +45,21 @@ static int send_data(nghttp3_conn *conn) { | |
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | ||
FuzzedDataProvider fuzzed_data_provider(data, size); | ||
nghttp3_callbacks callbacks{}; | ||
nghttp3_settings settings; | ||
|
||
nghttp3_settings settings; | ||
nghttp3_settings_default(&settings); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be kept because this is how we initialize nghttp3_settings in practice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. I made the change. |
||
settings.max_field_section_size = | ||
fuzzed_data_provider.ConsumeIntegralInRange<uint64_t>(0, | ||
NGHTTP3_MAX_VARINT); | ||
settings.qpack_max_dtable_capacity = | ||
fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, NGHTTP3_MAX_VARINT); | ||
settings.qpack_encoder_max_dtable_capacity = | ||
fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, NGHTTP3_MAX_VARINT); | ||
settings.qpack_blocked_streams = | ||
fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, NGHTTP3_MAX_VARINT); | ||
settings.enable_connect_protocol = | ||
fuzzed_data_provider.ConsumeIntegral<uint8_t>(); | ||
settings.h3_datagram = fuzzed_data_provider.ConsumeIntegral<uint8_t>(); | ||
|
||
nghttp3_conn *conn; | ||
auto rv = | ||
|
@@ -75,4 +97,4 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | |
nghttp3_conn_del(conn); | ||
|
||
return 0; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the line separator is missing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been added in #293
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it.