From 032a98438d61dabcbc1169f98c339dde8a67acff Mon Sep 17 00:00:00 2001 From: xx <0x7fancyxx@gmail.com> Date: Tue, 23 Jan 2024 18:49:54 +0800 Subject: [PATCH] fix: add growth check limit for 'random_recursive_mutation' --- src/grammar_mutator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/grammar_mutator.c b/src/grammar_mutator.c index bab4116..9644881 100644 --- a/src/grammar_mutator.c +++ b/src/grammar_mutator.c @@ -556,7 +556,11 @@ size_t afl_custom_fuzz(my_mutator_t *data, __attribute__((unused)) uint8_t *buf, const unsigned RRM_GROWTH = 10; // Allow 2**RRM_GROWTH of bytes of expansion tree_t *rrm_tree = NULL; tree_to_buf(tree); + int failed_count = 8; do { + if (failed_count-- <= 0) { + break; + } if (rrm_tree) tree_free(rrm_tree); rrm_tree =