Skip to content

Commit

Permalink
fix: add growth check limit for 'random_recursive_mutation'
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7Fancy committed Jan 23, 2024
1 parent 9c1e7a9 commit 032a984
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/grammar_mutator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 032a984

Please sign in to comment.