From e36522cf21b8b67452d282ec8234ab0c3bfebb5d Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Wed, 16 Mar 2022 11:07:36 +0100 Subject: [PATCH] Fix find_gaps_in_closures (#568) --- libafl/src/stages/generalization.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libafl/src/stages/generalization.rs b/libafl/src/stages/generalization.rs index d3ed77bd3b..f0a9a9ef8c 100644 --- a/libafl/src/stages/generalization.rs +++ b/libafl/src/stages/generalization.rs @@ -481,9 +481,11 @@ where } let mut start = index; let mut end = payload.len() - 1; + let mut endings = 0; // Process every ending while end > start { if payload[end] == Some(closing_char) { + endings += 1; let mut candidate = GeneralizedInput::new(vec![]); candidate .bytes_mut() @@ -502,6 +504,10 @@ where end -= 1; index += 1; } + + if endings == 0 { + break; + } } Self::trim_payload(payload);