From 9b4cd51c638e69204437838d381dd657b0cd2e4f Mon Sep 17 00:00:00 2001 From: s1341 Date: Tue, 24 Dec 2024 15:22:01 +0200 Subject: [PATCH] imemory_ondisk: Don't fail write under any circumstances if locking is 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 --- libafl/src/corpus/inmemory_ondisk.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libafl/src/corpus/inmemory_ondisk.rs b/libafl/src/corpus/inmemory_ondisk.rs index c2e0a5536b..8afccf93cb 100644 --- a/libafl/src/corpus/inmemory_ondisk.rs +++ b/libafl/src/corpus/inmemory_ondisk.rs @@ -442,7 +442,12 @@ impl InMemoryOnDiskCorpus { *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(()) }