Skip to content

Commit

Permalink
format files and call validate parsed using source
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosEduR committed Jun 5, 2024
1 parent fce8af2 commit 12bbf2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fuzz/idna.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ 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;
}
6 changes: 5 additions & 1 deletion fuzz/parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
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 @@ -186,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 12bbf2b

Please sign in to comment.