From 976d6b2e97d87cf6c4cc8d86b2dccbf2c139942d Mon Sep 17 00:00:00 2001 From: Anne Borcherding <55282902+anneborcherding@users.noreply.github.com> Date: Mon, 30 Oct 2023 17:58:54 +0100 Subject: [PATCH] [WithObservers] Call the wrapped observer's post run function (#1640) * [WithObservers] Call the wrapped observer's post run function * fix typo and naming of variable --- libafl/src/executors/inprocess.rs | 2 +- libafl/src/executors/with_observers.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libafl/src/executors/inprocess.rs b/libafl/src/executors/inprocess.rs index a3e5f3f8b3..9d22ccf3b3 100644 --- a/libafl/src/executors/inprocess.rs +++ b/libafl/src/executors/inprocess.rs @@ -1693,7 +1693,7 @@ where self.observers .pre_exec_child_all(state, input) - .expect("Failed to run post_exec on observers"); + .expect("Failed to run pre_exec on observers"); (self.harness_fn)(input); diff --git a/libafl/src/executors/with_observers.rs b/libafl/src/executors/with_observers.rs index 9d55b1309e..1ca1785420 100644 --- a/libafl/src/executors/with_observers.rs +++ b/libafl/src/executors/with_observers.rs @@ -30,7 +30,9 @@ where mgr: &mut EM, input: &Self::Input, ) -> Result { - self.executor.run_target(fuzzer, state, mgr, input) + let ret = self.executor.run_target(fuzzer, state, mgr, input); + self.executor.post_run_reset(); + ret } }