impl HasEventManagerId for LlmpRestartingEventManager (#2406)

This commit is contained in:
__gsch 2024-07-16 14:06:56 +02:00 committed by GitHub
parent 791598228e
commit d8e53d5b65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,7 @@
//! When the target crashes, a watch process (the parent) will //! When the target crashes, a watch process (the parent) will
//! restart/refork it. //! restart/refork it.
use alloc::vec::Vec; use alloc::{boxed::Box, vec::Vec};
#[cfg(all(unix, not(miri), feature = "std"))] #[cfg(all(unix, not(miri), feature = "std"))]
use core::ptr::addr_of_mut; use core::ptr::addr_of_mut;
#[cfg(feature = "std")] #[cfg(feature = "std")]
@ -36,7 +36,7 @@ use serde::{Deserialize, Serialize};
use typed_builder::TypedBuilder; use typed_builder::TypedBuilder;
#[cfg(feature = "std")] #[cfg(feature = "std")]
use crate::events::AdaptiveSerializer; use crate::events::{AdaptiveSerializer, CustomBufEventResult, HasCustomBufHandlers};
#[cfg(all(unix, feature = "std", not(miri)))] #[cfg(all(unix, feature = "std", not(miri)))]
use crate::events::EVENTMGR_SIGHANDLER_STATE; use crate::events::EVENTMGR_SIGHANDLER_STATE;
use crate::{ use crate::{
@ -251,6 +251,20 @@ where
} }
} }
#[cfg(feature = "std")]
impl<EMH, S, SP> HasCustomBufHandlers for LlmpRestartingEventManager<EMH, S, SP>
where
S: State,
SP: ShMemProvider,
{
fn add_custom_buf_handler(
&mut self,
handler: Box<dyn FnMut(&mut S, &str, &[u8]) -> Result<CustomBufEventResult, Error>>,
) {
self.llmp_mgr.add_custom_buf_handler(handler);
}
}
/// The llmp connection from the actual fuzzer to the process supervising it /// The llmp connection from the actual fuzzer to the process supervising it
const _ENV_FUZZER_SENDER: &str = "_AFL_ENV_FUZZER_SENDER"; const _ENV_FUZZER_SENDER: &str = "_AFL_ENV_FUZZER_SENDER";
const _ENV_FUZZER_RECEIVER: &str = "_AFL_ENV_FUZZER_RECEIVER"; const _ENV_FUZZER_RECEIVER: &str = "_AFL_ENV_FUZZER_RECEIVER";