#![no_main] use libfuzzer_sys::fuzz_target; use std::io::Write as _; fuzz_target!(|data: &[u8]| { // Write the fuzz input to a temporary file, then run it through the WAL // replay path. The goal: verify that no arbitrary byte sequence causes a // panic, OOM, or other safety violation. CRC32 mismatches, truncated // entries, bad magic bytes, and oversized length fields are all expected to // return an error (not crash). let Ok(mut tmp) = tempfile::NamedTempFile::new() else { return; }; if tmp.write_all(data).is_err() { return; } // Flush so the reader sees the data. let _ = tmp.flush(); let _ = clawhdf5_agent::wal::WalFile::read_entries(tmp.path()); });