Write a fuzz test
This commit is contained in:
parent
3517ef6513
commit
52347d8e6d
@ -18,5 +18,5 @@ git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
|
|||||||
members = ["."]
|
members = ["."]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "fuzz_target_1"
|
name = "fuzz_target_u8"
|
||||||
path = "fuzz_targets/fuzz_target_1.rs"
|
path = "fuzz_targets/fuzz_target_u8.rs"
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
#![no_main]
|
|
||||||
#[macro_use] extern crate libfuzzer_sys;
|
|
||||||
extern crate ssz;
|
|
||||||
|
|
||||||
fuzz_target!(|data: &[u8]| {
|
|
||||||
// fuzzed code goes here
|
|
||||||
});
|
|
10
eth2/utils/ssz/fuzz/fuzz_targets/fuzz_target_u8.rs
Normal file
10
eth2/utils/ssz/fuzz/fuzz_targets/fuzz_target_u8.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![no_main]
|
||||||
|
#[macro_use] extern crate libfuzzer_sys;
|
||||||
|
extern crate ssz;
|
||||||
|
|
||||||
|
use ssz::{DecodeError, Decodable, Encodable};
|
||||||
|
|
||||||
|
// Fuzz ssz_decode(u8)
|
||||||
|
fuzz_target!(|data: &[u8]| {
|
||||||
|
let result: Result<(u8, usize), DecodeError> = Decodable::ssz_decode(data, 0);
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user