mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 06:44:35 +00:00
Write a fuzz test
This commit is contained in:
@@ -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);
|
||||
});
|
||||
Reference in New Issue
Block a user