forked from quinn-rs/quinn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
74 additions
and
21 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
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,2 @@ | ||
[build] | ||
rustflags = "--cfg fuzzing" |
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
[package] | ||
name = "quinn-fuzz" | ||
version = "0.0.0" | ||
authors = ["Automatically generated"] | ||
name = "fuzz" | ||
version = "0.1.0" | ||
authors = [ | ||
"Benjamin Saunders <[email protected]>", "Dirkjan Ochtman <[email protected]>", | ||
] | ||
publish = false | ||
license = "MIT OR Apache-2.0" | ||
edition = "2018" | ||
|
||
[package.metadata] | ||
|
@@ -18,10 +21,6 @@ path = "../quinn-proto" | |
package = "quinn-proto" | ||
version = "0.6.1" | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] | ||
|
||
[[bin]] | ||
name = "streams" | ||
path = "fuzz_targets/streams.rs" | ||
|
@@ -33,3 +32,9 @@ name = "streamid" | |
path = "fuzz_targets/streamid.rs" | ||
test = false | ||
doc = false | ||
|
||
[[bin]] | ||
name = "packet" | ||
path = "fuzz_targets/packet.rs" | ||
test = false | ||
doc = false |
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,15 @@ | ||
#![no_main] | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use proto::fuzzing::{PacketParams, PartialDecode}; | ||
extern crate proto; | ||
|
||
fuzz_target!(|data: PacketParams| { | ||
let len = data.buf.len(); | ||
if let Ok(decoded) = PartialDecode::new(data.buf, data.local_cid_len) { | ||
match decoded.1 { | ||
Some(x) => assert_eq!(len, decoded.0.len() + x.len()), | ||
None => assert_eq!(len, decoded.0.len()), | ||
} | ||
} | ||
}); |
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
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