diff --git a/libafl/src/events/llmp/mod.rs b/libafl/src/events/llmp/mod.rs index e8a284973c..586dea66c8 100644 --- a/libafl/src/events/llmp/mod.rs +++ b/libafl/src/events/llmp/mod.rs @@ -18,7 +18,7 @@ use serde::Deserialize; #[cfg(feature = "share_objectives")] use crate::{ corpus::{Corpus, Testcase}, - state::{HasCorpus, HasSolutions}, + state::{HasCurrentTestcase, HasSolutions}, }; use crate::{ events::{CustomBufEventResult, CustomBufHandlerFn, Event, EventFirer}, @@ -395,7 +395,14 @@ where #[cfg(feature = "share_objectives")] impl LlmpEventConverter where - S: UsesInput + HasExecutions + HasMetadata + Stoppable + HasCorpus + HasSolutions, + S: UsesInput + + HasExecutions + + HasSolutions + + HasMetadata + + Stoppable + + State + + HasCurrentTestcase, + S::Solutions: Corpus, SP: ShMemProvider, IC: InputConverter, ICB: InputConverter, @@ -447,8 +454,14 @@ where return Ok(()); }; - let testcase = Testcase::from(converter.convert(input)?); + let converted_input = converter.convert(input)?; + let mut testcase = Testcase::from(converted_input); testcase.set_parent_id_optional(*state.corpus().current()); + + if let Ok(mut tc) = state.current_testcase_mut() { + tc.found_objective(); + } + state.solutions_mut().add(testcase)?; log::info!("Added received Objective to Corpus"); diff --git a/libafl/src/stages/sync.rs b/libafl/src/stages/sync.rs index a0ce464025..8cc521dd62 100644 --- a/libafl/src/stages/sync.rs +++ b/libafl/src/stages/sync.rs @@ -351,6 +351,7 @@ where DI: Input, <::Corpus as Corpus>::Input: Clone, S::Corpus: Corpus, // delete me + S::Solutions: Corpus, { #[inline] fn perform(