Skip to content

Commit

Permalink
More comprehensive fuzzer coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Sep 2, 2024
1 parent ca58129 commit 584dd98
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fuzz/fuzz_targets/fuzz_redb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl FuzzerBackend {

impl StorageBackend for FuzzerBackend {
fn len(&self) -> Result<u64, std::io::Error> {
self.check_countdown()?;
self.inner.len()
}

Expand All @@ -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(())
}
Expand Down

0 comments on commit 584dd98

Please sign in to comment.