diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 107ee9f..4587f8d 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -42,3 +42,15 @@ name = "parse_response" path = "fuzz_targets/parse_response.rs" test = false doc = false + +[[bin]] +name = "parse_response_multspaces" +path = "fuzz_targets/parse_response_multspaces.rs" +test = false +doc = false + +[[bin]] +name = "parse_request_multspaces" +path = "fuzz_targets/parse_request_multspaces.rs" +test = false +doc = false diff --git a/fuzz/fuzz_targets/parse_request_multspaces.rs b/fuzz/fuzz_targets/parse_request_multspaces.rs new file mode 100644 index 0000000..dfa8395 --- /dev/null +++ b/fuzz/fuzz_targets/parse_request_multspaces.rs @@ -0,0 +1,11 @@ +#![no_main] + +use libfuzzer_sys::fuzz_target; + +fuzz_target!(|data: &[u8]| { + let mut headers = [httparse::EMPTY_HEADER; 16]; + let mut resp = httparse::Request::new(&mut headers); + let _ = httparse::ParserConfig::default() + .allow_multiple_spaces_in_request_line_delimiters(true) + .parse_request(&mut resp, data); +}); diff --git a/fuzz/fuzz_targets/parse_response_multspaces.rs b/fuzz/fuzz_targets/parse_response_multspaces.rs new file mode 100644 index 0000000..ceba2f4 --- /dev/null +++ b/fuzz/fuzz_targets/parse_response_multspaces.rs @@ -0,0 +1,11 @@ +#![no_main] + +use libfuzzer_sys::fuzz_target; + +fuzz_target!(|data: &[u8]| { + let mut headers = [httparse::EMPTY_HEADER; 16]; + let mut resp = httparse::Response::new(&mut headers); + let _ = httparse::ParserConfig::default() + .allow_multiple_spaces_in_response_status_delimiters(true) + .parse_response(&mut resp, data); +});