Skip to content

Commit

Permalink
Call ascii_has_upper_case from idna fuzzer (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosEduR committed Jun 5, 2024
1 parent 1c30576 commit 14d0eaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

0 comments on commit 14d0eaf

Please sign in to comment.