Skip to content

Commit 5249843

Browse files
committed
Make input loading fallible in SyncFromDiskStage
1 parent c0e32cd commit 5249843

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libafl/src/stages/sync.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl<CB, E, EM, I, S, Z> Named for SyncFromDiskStage<CB, E, EM, I, S, Z> {
7575

7676
impl<CB, E, EM, I, S, Z> Stage<E, EM, S, Z> for SyncFromDiskStage<CB, E, EM, I, S, Z>
7777
where
78-
CB: FnMut(&mut Z, &mut S, &Path) -> Result<I, Error>,
78+
CB: FnMut(&mut Z, &mut S, &Path) -> Result<Option<I>, Error>,
7979
Z: Evaluator<E, EM, I, S>,
8080
S: HasCorpus<I>
8181
+ HasRand
@@ -134,6 +134,9 @@ where
134134
.unwrap()
135135
.left_to_sync
136136
.retain(|p| p != &path);
137+
let Some(input) = input else {
138+
continue;
139+
};
137140
log::debug!("Syncing and evaluating {path:?}");
138141
fuzzer.evaluate_input(state, executor, manager, &input)?;
139142
}

0 commit comments

Comments
 (0)