Skip to content

Commit

Permalink
Fix empty multipart name (#2750)
Browse files Browse the repository at this point in the history
  • Loading branch information
riesentoaster authored Dec 6, 2024
1 parent 0569960 commit 42ba65e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions libafl/src/inputs/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,16 @@ where
I: Input,
{
fn generate_name(&self, id: Option<CorpusId>) -> String {
self.names
.iter()
.cloned()
.zip(self.parts.iter().map(|i| i.generate_name(id)))
.map(|(name, generated)| format!("{name}-{generated}"))
.collect::<Vec<_>>()
.join(",")
if self.names().len() > 0 {
self.names
.iter()
.cloned()
.zip(self.parts.iter().map(|i| i.generate_name(id)))
.map(|(name, generated)| format!("{name}-{generated}"))
.collect::<Vec<_>>()
.join(",")
} else {
"empty_multipart".to_string() // empty strings cause issues with OnDiskCorpus
}
}
}

0 comments on commit 42ba65e

Please sign in to comment.