Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ForkserverExecutorBuilder::shmem_provider (#2539) #2540

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions libafl/src/executors/forkserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,9 @@ impl<'a> ForkserverExecutorBuilder<'a, UnixShMemProvider> {
shmem_provider: &'a mut SP,
) -> ForkserverExecutorBuilder<'a, SP> {
ForkserverExecutorBuilder {
// Set the new provider
shmem_provider: Some(shmem_provider),
// Copy all other values from the old Builder
program: self.program,
arguments: self.arguments,
envs: self.envs,
Expand All @@ -1319,14 +1322,13 @@ impl<'a> ForkserverExecutorBuilder<'a, UnixShMemProvider> {
is_deferred_frksrv: self.is_deferred_frksrv,
autotokens: self.autotokens,
input_filename: self.input_filename,
shmem_provider: Some(shmem_provider),
map_size: self.map_size,
max_input_size: MAX_INPUT_SIZE_DEFAULT,
min_input_size: MIN_INPUT_SIZE_DEFAULT,
kill_signal: None,
timeout: None,
asan_obs: None,
crash_exitcode: None,
max_input_size: self.max_input_size,
min_input_size: self.min_input_size,
kill_signal: self.kill_signal,
timeout: self.timeout,
asan_obs: self.asan_obs,
crash_exitcode: self.crash_exitcode,
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion libafl/src/inputs/bytessub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ where
}

impl<'a, I> MappedInput for BytesSubInput<'a, I> {
type Type<'b> = BytesSubInput<'b, I> where Self: 'b;
type Type<'b>
= BytesSubInput<'b, I>
where
Self: 'b;
}

#[cfg(test)]
Expand Down
11 changes: 8 additions & 3 deletions libafl/src/inputs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ impl<T> MappedInput for Option<T>
where
T: MappedInput,
{
type Type<'a> = Option<T::Type<'a>>
where T: 'a;
type Type<'a>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arbitrary change in cargo fmt lol

= Option<T::Type<'a>>
where
T: 'a;
}

/// A wrapper type that allows us to use mutators for Mutators for `&mut `[`Vec`].
Expand Down Expand Up @@ -263,7 +265,10 @@ impl<'a> HasMutatorBytes for MutVecInput<'a> {
}

impl<'a> MappedInput for MutVecInput<'a> {
type Type<'b> = MutVecInput<'b> where Self: 'b;
type Type<'b>
= MutVecInput<'b>
where
Self: 'b;
}

/// Defines the input type shared across traits of the type.
Expand Down
Loading