From 03f7fc93ad17811a1a1153c0e1d6d541bc9400ba Mon Sep 17 00:00:00 2001 From: Valentin Huber Date: Mon, 23 Dec 2024 11:39:51 +0100 Subject: [PATCH] Fix empty multipart (#2789) --- libafl/src/mutators/multi.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libafl/src/mutators/multi.rs b/libafl/src/mutators/multi.rs index 032e35433c..66dd1ab672 100644 --- a/libafl/src/mutators/multi.rs +++ b/libafl/src/mutators/multi.rs @@ -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]; @@ -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];