Skip to content

Commit

Permalink
Fix crossover mutators for empty multipart inputs (AFLplusplus#2663)
Browse files Browse the repository at this point in the history
  • Loading branch information
riesentoaster authored Nov 5, 2024
1 parent 87e4a84 commit 4431f06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libafl/src/mutators/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ where
let id = random_corpus_id!(state.corpus(), state.rand_mut());
if let Some(cur) = state.corpus().current() {
if id == *cur {
if input.names().is_empty() {
return Ok(MutationResult::Skipped);
}
let choice = name_choice % input.names().len();
let name = input.names()[choice].clone();

Expand Down Expand Up @@ -264,6 +267,9 @@ where
let id = random_corpus_id!(state.corpus(), state.rand_mut());
if let Some(cur) = state.corpus().current() {
if id == *cur {
if input.names().is_empty() {
return Ok(MutationResult::Skipped);
}
let choice = name_choice % input.names().len();
let name = input.names()[choice].clone();

Expand Down

0 comments on commit 4431f06

Please sign in to comment.