|
@@ -13,7 +13,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|
|
size_t payload_size = size - 1;
|
|
size_t payload_size = size - 1;
|
|
|
std::string input(payload, payload_size);
|
|
std::string input(payload, payload_size);
|
|
|
|
|
|
|
|
- switch (selector % 6) {
|
|
|
|
|
|
|
+ switch (selector % 13) {
|
|
|
case 0: {
|
|
case 0: {
|
|
|
// parse_query_text
|
|
// parse_query_text
|
|
|
httplib::Params params;
|
|
httplib::Params params;
|
|
@@ -46,6 +46,48 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|
|
httplib::detail::is_valid_path(input);
|
|
httplib::detail::is_valid_path(input);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ case 6: {
|
|
|
|
|
+ // parse_url
|
|
|
|
|
+ httplib::detail::UrlComponents uc;
|
|
|
|
|
+ httplib::detail::parse_url(input, uc);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 7: {
|
|
|
|
|
+ // remove_dot_segments
|
|
|
|
|
+ httplib::detail::remove_dot_segments(input);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 8: {
|
|
|
|
|
+ // resolve_relative_location, with the input as "<location>\n<base>"
|
|
|
|
|
+ auto nl = input.find('\n');
|
|
|
|
|
+ auto location = input.substr(0, nl);
|
|
|
|
|
+ auto base = nl == std::string::npos ? std::string("/index.html")
|
|
|
|
|
+ : input.substr(nl + 1);
|
|
|
|
|
+ httplib::detail::resolve_relative_location(location, base);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 9: {
|
|
|
|
|
+ // encode_path
|
|
|
|
|
+ httplib::detail::encode_path(input);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 10: {
|
|
|
|
|
+ // encode_uri_component, encode_uri
|
|
|
|
|
+ httplib::encode_uri_component(input);
|
|
|
|
|
+ httplib::encode_uri(input);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 11: {
|
|
|
|
|
+ // decode_uri_component, decode_uri
|
|
|
|
|
+ httplib::decode_uri_component(input);
|
|
|
|
|
+ httplib::decode_uri(input);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case 12: {
|
|
|
|
|
+ // sanitize_filename
|
|
|
|
|
+ httplib::sanitize_filename(input);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|