Skip to content

Commit

Permalink
Fix empty multipart (#2789)
Browse files Browse the repository at this point in the history
  • Loading branch information
riesentoaster authored Dec 23, 2024
1 parent 25386bf commit 03f7fc9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libafl/src/mutators/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ where
let mut other_testcase = state.corpus().get(id)?.borrow_mut();
let other = other_testcase.load_input(state.corpus())?;

if other.names().is_empty() {
return Ok(MutationResult::Skipped);
}

let choice = name_choice % other.names().len();
let name = &other.names()[choice];

Expand Down Expand Up @@ -324,6 +328,10 @@ where
let mut other_testcase = state.corpus().get(id)?.borrow_mut();
let other = other_testcase.load_input(state.corpus())?;

if other.names().is_empty() {
return Ok(MutationResult::Skipped);
}

let choice = name_choice % other.names().len();
let name = &other.names()[choice];

Expand Down

0 comments on commit 03f7fc9

Please sign in to comment.