Skip to content
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

Call ascii_has_upper_case from idna fuzzer #687

Merged
merged 2 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fuzz/idna.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
*/
ada::idna::to_ascii(source);
ada::idna::to_unicode(source);
ada::idna::ascii_has_upper_case(source.data(), source.length());

return 0;
}
8 changes: 7 additions & 1 deletion fuzz/parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {

if (parse_url) {
length += parse_url->get_href().size();
length += parse_url->get_origin().size();
}

if (parse_url_aggregator) {
length += parse_url_aggregator->get_href().size();
length += parse_url_aggregator->get_origin().size();

volatile bool is_parse_url_aggregator_output_valid = false;
is_parse_url_aggregator_output_valid = parse_url_aggregator->validate();

assert(parse_url->get_protocol() == parse_url_aggregator->get_protocol());
assert(parse_url->get_href() == parse_url_aggregator->get_href());
Expand Down Expand Up @@ -184,8 +189,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
length += out_aggregator->get_origin().size();
length += out_aggregator->get_port().size();

volatile bool is_output_valid = false;
length += out_aggregator->to_string().size();

volatile bool is_output_valid = false;
is_output_valid = out_aggregator->validate();

// Printing due to dead-code elimination
Expand Down
Loading