From 30cc97633f73b83f8a091b41854a1f11b2460e05 Mon Sep 17 00:00:00 2001 From: Christopher Berner Date: Mon, 2 Sep 2024 15:18:15 -0700 Subject: [PATCH] More comprehensive fuzzer coverage --- fuzz/fuzz_targets/fuzz_redb.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fuzz/fuzz_targets/fuzz_redb.rs b/fuzz/fuzz_targets/fuzz_redb.rs index 74b11ffd..2beff1ec 100644 --- a/fuzz/fuzz_targets/fuzz_redb.rs +++ b/fuzz/fuzz_targets/fuzz_redb.rs @@ -55,6 +55,7 @@ impl FuzzerBackend { impl StorageBackend for FuzzerBackend { fn len(&self) -> Result { + self.check_countdown()?; self.inner.len() } @@ -64,10 +65,12 @@ impl StorageBackend for FuzzerBackend { } fn set_len(&self, len: u64) -> Result<(), std::io::Error> { + self.decrement_countdown()?; self.inner.set_len(len) } fn sync_data(&self, _eventual: bool) -> Result<(), std::io::Error> { + self.decrement_countdown()?; // No-op. The fuzzer doesn't test crashes, so fsync is unnecessary Ok(()) }