-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Two targets to start with: 1) decompression into a growable writer, 2) decompression into a fixed-size buffer, The latter finds dropbox/rust-brotli#213 quite quickly.
- Loading branch information
Showing
4 changed files
with
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target | ||
corpus | ||
artifacts | ||
coverage |
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,32 @@ | ||
[package] | ||
name = "brotli-decompressor-fuzz" | ||
version = "0.0.0" | ||
publish = false | ||
|
||
[package.metadata] | ||
cargo-fuzz = true | ||
|
||
[dependencies] | ||
libfuzzer-sys = "0.4" | ||
|
||
[dependencies.brotli-decompressor] | ||
path = ".." | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] | ||
|
||
[profile.release] | ||
debug = 1 | ||
|
||
[[bin]] | ||
name = "decompress_into_vec" | ||
path = "fuzz_targets/decompress_into_vec.rs" | ||
test = false | ||
doc = false | ||
|
||
[[bin]] | ||
name = "decompress_into_fixed" | ||
path = "fuzz_targets/decompress_into_fixed.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,13 @@ | ||
#![no_main] | ||
|
||
extern crate libfuzzer_sys; | ||
|
||
use std::io::Cursor; | ||
use libfuzzer_sys::fuzz_target; | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
let mut input = Cursor::new(data); | ||
let mut output_buf = [0u8; 2048]; | ||
let mut output = Cursor::new(&mut output_buf[..]); | ||
let _ = brotli_decompressor::BrotliDecompress(&mut input, &mut output); | ||
}); |
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,12 @@ | ||
#![no_main] | ||
|
||
extern crate libfuzzer_sys; | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use std::io::Cursor; | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
let mut input = Cursor::new(data); | ||
let mut output = Cursor::new(Vec::new()); | ||
let _ = brotli_decompressor::BrotliDecompress(&mut input, &mut output); | ||
}); |