Modifications to fuzz tests

This commit is contained in:
Kirk Baird 2019-03-07 17:50:00 +11:00
parent 3ae7d24d17
commit 08b803b6e7
No known key found for this signature in database
GPG Key ID: F219259359169C28
6 changed files with 45 additions and 10 deletions

View File

@ -88,6 +88,18 @@ path = "fuzz_targets/fuzz_target_address_encode.rs"
name = "fuzz_target_vec_decode"
path = "fuzz_targets/fuzz_target_vec_decode.rs"
[[bin]]
name = "fuzz_target_vec_address_decode"
path = "fuzz_targets/fuzz_target_vec_address_decode.rs"
[[bin]]
name = "fuzz_target_vec_u64_decode"
path = "fuzz_targets/fuzz_target_vec_u64_decode.rs"
[[bin]]
name = "fuzz_target_vec_bool_decode"
path = "fuzz_targets/fuzz_target_vec_bool_decode.rs"
[[bin]]
name = "fuzz_target_vec_encode"
path = "fuzz_targets/fuzz_target_vec_encode.rs"

View File

@ -0,0 +1,12 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate ethereum_types;
extern crate ssz;
use ethereum_types::{Address};
use ssz::{DecodeError, Decodable};
// Fuzz ssz_decode()
fuzz_target!(|data: &[u8]| {
let _result: Result<(Vec<Address>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
});

View File

@ -0,0 +1,10 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate ssz;
use ssz::{DecodeError, Decodable};
// Fuzz ssz_decode()
fuzz_target!(|data: &[u8]| {
let _result: Result<(Vec<bool>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
});

View File

@ -9,13 +9,4 @@ use ssz::{DecodeError, Decodable};
// Fuzz ssz_decode()
fuzz_target!(|data: &[u8]| {
let _result: Result<(Vec<u8>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
/*
let _result: Result<(Vec<u16>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
let _result: Result<(Vec<u32>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
let _result: Result<(Vec<u64>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
let _result: Result<(Vec<usize>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
let _result: Result<(Vec<Address>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
let _result: Result<(Vec<H256>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
let _result: Result<(Vec<bool>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
*/
});

View File

@ -6,7 +6,7 @@ extern crate ssz;
use ethereum_types::{Address, H256};
use ssz::SszStream;
// Fuzz ssz_decode()
// Fuzz ssz_encode()
fuzz_target!(|data: &[u8]| {
let mut ssz = SszStream::new();

View File

@ -0,0 +1,10 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate ssz;
use ssz::{DecodeError, Decodable};
// Fuzz ssz_decode()
fuzz_target!(|data: &[u8]| {
let _result: Result<(Vec<u64>, usize), DecodeError> = Decodable::ssz_decode(data, 0);
});