about summary refs log tree commit diff
path: root/src/afl-fuzz-queue.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2024-06-01 16:37:28 +0200
committerGitHub <noreply@github.com>2024-06-01 16:37:28 +0200
commit348f980f2180a5bab745066f8c7dcd0049998626 (patch)
tree34bb1853847ce6ee80ffe57c3ce581195be3238f /src/afl-fuzz-queue.c
parente7d871c8bf64962a658e447b90a1a3b43aaddc28 (diff)
parentca55858aa7ecb1a4cd420e3c325fe604a5b5c30d (diff)
downloadafl++-348f980f2180a5bab745066f8c7dcd0049998626.tar.gz
Merge pull request #2108 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-fuzz-queue.c')
-rw-r--r--src/afl-fuzz-queue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c
index 2318df60..784b377a 100644
--- a/src/afl-fuzz-queue.c
+++ b/src/afl-fuzz-queue.c
@@ -1301,7 +1301,8 @@ inline u8 *queue_testcase_get(afl_state_t *afl, struct queue_entry *q) {
     static u32 do_once = 0;  // because even threaded we would want this. WIP
 
     while (unlikely(
-        afl->q_testcase_cache_size + len >= afl->q_testcase_max_cache_size ||
+        (afl->q_testcase_cache_size + len >= afl->q_testcase_max_cache_size &&
+         afl->q_testcase_cache_count > 1) ||
         afl->q_testcase_cache_count >= afl->q_testcase_max_cache_entries - 1)) {
 
       /* We want a max number of entries to the cache that we learn.