From ac11191f714c57fcd8f8a3471c361b28de96df8b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 6 Sep 2018 15:52:38 -0400 Subject: [PATCH] Upgrade AFL to 0.4 with persistent mode fuzzing --- fuzz/Cargo.toml | 2 +- fuzz/fuzz_targets/deserialize_address.rs | 4 ++-- fuzz/fuzz_targets/deserialize_block.rs | 4 ++-- fuzz/fuzz_targets/deserialize_decimal.rs | 4 ++-- fuzz/fuzz_targets/deserialize_script.rs | 4 ++-- fuzz/fuzz_targets/deserialize_transaction.rs | 4 ++-- fuzz/fuzz_targets/deserialize_udecimal.rs | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 990bf0ac..92f2838d 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -13,7 +13,7 @@ honggfuzz_fuzz = ["honggfuzz"] [dependencies] honggfuzz = { version = "0.5", optional = true } -afl = { version = "0.3", optional = true } +afl = { version = "0.4", optional = true } bitcoin = { path = "..", features = ["fuzztarget", "serde-decimal"] } # Prevent this from interfering with workspaces diff --git a/fuzz/fuzz_targets/deserialize_address.rs b/fuzz/fuzz_targets/deserialize_address.rs index 9bb71fe6..4a26a20c 100644 --- a/fuzz/fuzz_targets/deserialize_address.rs +++ b/fuzz/fuzz_targets/deserialize_address.rs @@ -10,10 +10,10 @@ fn do_test(data: &[u8]) { } #[cfg(feature = "afl")] -extern crate afl; +#[macro_use] extern crate afl; #[cfg(feature = "afl")] fn main() { - afl::read_stdio_bytes(|data| { + fuzz!(|data| { do_test(&data); }); } diff --git a/fuzz/fuzz_targets/deserialize_block.rs b/fuzz/fuzz_targets/deserialize_block.rs index cb314ad0..f9364f4a 100644 --- a/fuzz/fuzz_targets/deserialize_block.rs +++ b/fuzz/fuzz_targets/deserialize_block.rs @@ -5,10 +5,10 @@ fn do_test(data: &[u8]) { } #[cfg(feature = "afl")] -extern crate afl; +#[macro_use] extern crate afl; #[cfg(feature = "afl")] fn main() { - afl::read_stdio_bytes(|data| { + fuzz!(|data| { do_test(&data); }); } diff --git a/fuzz/fuzz_targets/deserialize_decimal.rs b/fuzz/fuzz_targets/deserialize_decimal.rs index 002bb760..78e3c605 100644 --- a/fuzz/fuzz_targets/deserialize_decimal.rs +++ b/fuzz/fuzz_targets/deserialize_decimal.rs @@ -14,10 +14,10 @@ fn do_test(data: &[u8]) { } #[cfg(feature = "afl")] -extern crate afl; +#[macro_use] extern crate afl; #[cfg(feature = "afl")] fn main() { - afl::read_stdio_bytes(|data| { + fuzz!(|data| { do_test(&data); }); } diff --git a/fuzz/fuzz_targets/deserialize_script.rs b/fuzz/fuzz_targets/deserialize_script.rs index 0d10d1a2..8bf7ab19 100644 --- a/fuzz/fuzz_targets/deserialize_script.rs +++ b/fuzz/fuzz_targets/deserialize_script.rs @@ -36,10 +36,10 @@ fn do_test(data: &[u8]) { } #[cfg(feature = "afl")] -extern crate afl; +#[macro_use] extern crate afl; #[cfg(feature = "afl")] fn main() { - afl::read_stdio_bytes(|data| { + fuzz!(|data| { do_test(&data); }); } diff --git a/fuzz/fuzz_targets/deserialize_transaction.rs b/fuzz/fuzz_targets/deserialize_transaction.rs index 505606c3..7df5ffd0 100644 --- a/fuzz/fuzz_targets/deserialize_transaction.rs +++ b/fuzz/fuzz_targets/deserialize_transaction.rs @@ -17,10 +17,10 @@ fn do_test(data: &[u8]) { } #[cfg(feature = "afl")] -extern crate afl; +#[macro_use] extern crate afl; #[cfg(feature = "afl")] fn main() { - afl::read_stdio_bytes(|data| { + fuzz!(|data| { do_test(&data); }); } diff --git a/fuzz/fuzz_targets/deserialize_udecimal.rs b/fuzz/fuzz_targets/deserialize_udecimal.rs index 558b1e31..1451ad2b 100644 --- a/fuzz/fuzz_targets/deserialize_udecimal.rs +++ b/fuzz/fuzz_targets/deserialize_udecimal.rs @@ -14,10 +14,10 @@ fn do_test(data: &[u8]) { } #[cfg(feature = "afl")] -extern crate afl; +#[macro_use] extern crate afl; #[cfg(feature = "afl")] fn main() { - afl::read_stdio_bytes(|data| { + fuzz!(|data| { do_test(&data); }); }