-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cargo-fuzz: add new target to parse responses Add a new cargo-fuzz target to test the Response parsing code. * cargo-fuzz: add new targets with relaxed multiple space options Add two new targets to fuzz parsing requests and responses with multiple spaces enabled via ParserConfig.
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#![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 _ = resp.parse(data); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); |