1 #![no_main] 2 3 use libfuzzer_sys::fuzz_target; 4 use memchr::memmem; 5 6 fuzz_target!(|data: &[u8]| { 7 if data.len() < 2 { 8 return; 9 } 10 let split = std::cmp::max(data[0] as usize, 1) % data.len() as usize; 11 let (needle, haystack) = (&data[..split], &data[split..]); 12 memmem::rfind_iter(haystack, needle).count(); 13 }); 14