Skip to content

Commit

Permalink
add recv_blocking_with_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
addisoncrump committed Apr 25, 2024
1 parent 4c95d90 commit 361bfb9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fuzzers/libfuzzer_libpng/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn fuzz(corpus_dirs: &[PathBuf], objective_dir: PathBuf, broker_port: u16) -> Re

// Setup a basic mutator with a mutational stage

let mutator = StdScheduledMutator::new(havoc_mutations().merge(tokens_mutations()));
let mutator = StdScheduledMutator::with_max_stack_pow(havoc_mutations().merge(tokens_mutations()), 1);

let power = StdPowerMutationalStage::new(mutator);

Expand Down
21 changes: 21 additions & 0 deletions libafl_bolts/src/llmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,21 @@ where
}
}

/// Receive the buffer, also reading the LLMP internal message flags
#[allow(clippy::type_complexity)]
#[inline]
pub fn recv_buf_blocking_with_flags(&mut self) -> Result<(ClientId, Tag, Flags, &[u8]), Error> {
unsafe {
let msg = self.recv_blocking()?;
Ok((
(*msg).sender,
(*msg).tag,
(*msg).flags,
(*msg).try_as_slice(&mut self.current_recv_shmem)?,
))
}
}

/// Returns the next sender, tag, buf, looping until it becomes available
#[inline]
pub fn recv_buf_blocking(&mut self) -> Result<(ClientId, Tag, &[u8]), Error> {
Expand Down Expand Up @@ -3222,6 +3237,12 @@ where
self.receiver.recv_buf_with_flags()
}

/// Receive a `buf` from the broker, including the `flags` used during transmission.
#[allow(clippy::type_complexity)]
pub fn recv_buf_blocking_with_flags(&mut self) -> Result<(ClientId, Tag, Flags, &[u8]), Error> {
self.receiver.recv_buf_blocking_with_flags()
}

#[cfg(feature = "std")]
/// Creates a new [`LlmpClient`], reading the map id and len from env
pub fn create_using_env(mut shmem_provider: SP, env_var: &str) -> Result<Self, Error> {
Expand Down

0 comments on commit 361bfb9

Please sign in to comment.