From 3453d02b1d1bcd05f8a920f28b2dfb68cab3d64b Mon Sep 17 00:00:00 2001 From: Alwin Berger Date: Fri, 3 May 2024 13:28:49 +0200 Subject: [PATCH] fix fuzzing loop returning nothing --- libafl/src/fuzzer/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libafl/src/fuzzer/mod.rs b/libafl/src/fuzzer/mod.rs index e3334dec1c..2a2072d9d1 100644 --- a/libafl/src/fuzzer/mod.rs +++ b/libafl/src/fuzzer/mod.rs @@ -303,6 +303,10 @@ where // But as the state may grow to a few megabytes, // for now we won' and the user has to do it (unless we find a way to do this on `Drop`). + if let None = ret { + eprintln!("Warning: fuzzing loop ended with no last element"); + ret = Some(crate::corpus::CorpusId(0)); + } Ok(ret.unwrap()) } }