Add fuzzing code
This commit is contained in:
parent
a74efe6f8c
commit
3cf1ccf8f8
|
@ -0,0 +1,4 @@
|
|||
|
||||
target
|
||||
corpus
|
||||
artifacts
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
[package]
|
||||
name = "bitcoin-fuzz"
|
||||
version = "0.0.1"
|
||||
authors = ["Automatically generated"]
|
||||
publish = false
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
|
||||
[dependencies.bitcoin]
|
||||
path = ".."
|
||||
[dependencies.libfuzzer-sys]
|
||||
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
|
||||
|
||||
# Prevent this from interfering with workspaces
|
||||
[workspace]
|
||||
members = ["."]
|
||||
|
||||
[[bin]]
|
||||
name = "fuzzer_script_1"
|
||||
path = "fuzzers/fuzzer_script_1.rs"
|
|
@ -0,0 +1,13 @@
|
|||
#![no_main]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
extern crate bitcoin;
|
||||
|
||||
type BResult = Result<bitcoin::blockdata::script::Script, bitcoin::util::Error>;
|
||||
//type BResult = Result<bitcoin::blockdata::transaction::Transaction, bitcoin::util::Error>;
|
||||
//type BResult = Result<bitcoin::blockdata::transaction::TxIn, bitcoin::util::Error>;
|
||||
//type BResult = Result<bitcoin::blockdata::transaction::TxOut, bitcoin::util::Error>;
|
||||
//type BResult = Result<bitcoin::network::constants::Network, bitcoin::util::Error>;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let _: BResult = bitcoin::network::serialize::deserialize(data);
|
||||
});
|
Loading…
Reference in New Issue