Skip to content

Commit

Permalink
imemory_ondisk: Don't fail write under any circumstances if locking i…
Browse files Browse the repository at this point in the history
…s disabled (#2791)

* imemory_ondisk: Don't fail write under any circumstances if locking is disabled

* fmt

* inmemory_ondisk: Add a log message on failure

* clippy'

* micro optimization
  • Loading branch information
s1341 authored Dec 24, 2024
1 parent 6927d61 commit 9b4cd51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libafl/src/corpus/inmemory_ondisk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,12 @@ impl<I> InMemoryOnDiskCorpus<I> {
*testcase.metadata_path_mut() = Some(metafile_path);
}

self.store_input_from(testcase)?;
if let Err(err) = self.store_input_from(testcase) {
if self.locking {
return Err(err);
}
log::error!("An error occurred when trying to write a testcase without locking: {err}");
}
Ok(())
}

Expand Down

0 comments on commit 9b4cd51

Please sign in to comment.