ada-url / ada

WHATWG-compliant and fast URL parser written in modern C++
https://ada-url.com
Apache License 2.0
1.26k stars 77 forks source link

Add fuzzer for href setter and getter #657

Closed CarlosEduR closed 1 month ago

CarlosEduR commented 1 month ago

In order to improve the line coverage for fuzz testing, add fuzzer for set_href and get_href

anonrig commented 1 month ago

cc @lemire i have bad news and good news

lemire commented 1 month ago

@anonrig

Indeed, the fuzzer found a bug, here it is...

https://github.com/ada-url/ada/pull/659

It is easy to narrow it down, just follow this recipe:

https://gist.github.com/lemire/f501b3b2bb8c33673de4f0a0674a6112

Takes a minute!!!

Fuzzers are great.

lemire commented 1 month ago

See https://github.com/ada-url/ada/issues/662

lemire commented 1 month ago

I expect that I have a fix for the bug in question at https://github.com/ada-url/ada/pull/659

lemire commented 1 month ago

@CarlosEduR Please rebase. I have merged a bug fix.

CarlosEduR commented 1 month ago

thanks @lemire! I was initially thinking it was something with the .to_string(), but now I see it was with the .set_pathname().

CarlosEduR commented 1 month ago

See #662

@lemire about this comparative fuzzer, are you thinking about comparing the results of the get_href between the ada::url and the ada::url_aggregator in the fuzzer?

lemire commented 1 month ago

I am!!!!!!!!!

CarlosEduR commented 1 month ago

I am!!!!!!!!!

@lemire assertion added!