chore(zseri/store-ref-scanner): use tailored fuzz input

Change-Id: Ib061154c2329432469e8f7bef4598402a56bd0c3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4606
Reviewed-by: zseri <zseri.devel@ytrizja.de>
Tested-by: BuildkiteCI
This commit is contained in:
zseri 2021-12-25 06:12:08 +01:00
parent 1cc8aa56a4
commit d6b0aca7dd

View file

@ -1,13 +1,10 @@
#![no_main] #![no_main]
use libfuzzer_sys::fuzz_target; use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| { fuzz_target!(|data: [u8; 16]| {
use core::convert::TryInto;
use store_ref_scanner::HalfBytesMask; use store_ref_scanner::HalfBytesMask;
for i in data.chunks_exact(16) { let a = HalfBytesMask(data);
let a = HalfBytesMask(i.try_into().unwrap()); let b = a.into_expanded();
let b = a.into_expanded(); let c = HalfBytesMask::from_expanded(b);
let c = HalfBytesMask::from_expanded(b); assert_eq!(a, c);
assert_eq!(a, c);
}
}); });