Fix empty multipart (#2789)

This commit is contained in:
Valentin Huber 2024-12-23 11:39:51 +01:00 committed by GitHub
parent 25386bfb5f
commit 03f7fc93ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -198,6 +198,10 @@ where
let mut other_testcase = state.corpus().get(id)?.borrow_mut(); let mut other_testcase = state.corpus().get(id)?.borrow_mut();
let other = other_testcase.load_input(state.corpus())?; 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 choice = name_choice % other.names().len();
let name = &other.names()[choice]; let name = &other.names()[choice];
@ -324,6 +328,10 @@ where
let mut other_testcase = state.corpus().get(id)?.borrow_mut(); let mut other_testcase = state.corpus().get(id)?.borrow_mut();
let other = other_testcase.load_input(state.corpus())?; 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 choice = name_choice % other.names().len();
let name = &other.names()[choice]; let name = &other.names()[choice];