Skip to content

Commit

Permalink
Fixing Empty MultipartInput Names Part 2 (#2751)
Browse files Browse the repository at this point in the history
* fixing empty multipart name

* fixing clippy
  • Loading branch information
riesentoaster authored Dec 6, 2024
1 parent e602d26 commit c2a9018
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libafl/src/inputs/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ where
I: Input,
{
fn generate_name(&self, id: Option<CorpusId>) -> String {
if self.names().len() > 0 {
if self.names().is_empty() {
"empty_multipart_input".to_string() // empty strings cause issues with OnDiskCorpus
} else {
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 c2a9018

Please sign in to comment.