aboutsummaryrefslogtreecommitdiff
path: root/src/afl-fuzz-queue.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-03-24 11:25:33 +0100
committerGitHub <noreply@github.com>2021-03-24 11:25:33 +0100
commitf0e08e648609e57732a76e285e57714c6d5fd2cd (patch)
tree9d35021985e2b6ea2b2988f318195d238e6fabc3 /src/afl-fuzz-queue.c
parent37829765282421d9e3cb9448bceedcb58256e76a (diff)
parent2dac4e785fa9f27e8c59bb504cfa8942eba938be (diff)
downloadafl++-f0e08e648609e57732a76e285e57714c6d5fd2cd.tar.gz
Merge pull request #842 from AFLplusplus/stable
3.12c release
Diffstat (limited to 'src/afl-fuzz-queue.c')
-rw-r--r--src/afl-fuzz-queue.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c
index b2f88205..e5f51a6c 100644
--- a/src/afl-fuzz-queue.c
+++ b/src/afl-fuzz-queue.c
@@ -249,7 +249,7 @@ void mark_as_det_done(afl_state_t *afl, struct queue_entry *q) {
snprintf(fn, PATH_MAX, "%s/queue/.state/deterministic_done/%s", afl->out_dir,
strrchr(q->fname, '/') + 1);
- fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0600);
+ fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, DEFAULT_PERMISSION);
if (fd < 0) { PFATAL("Unable to create '%s'", fn); }
close(fd);
@@ -272,7 +272,7 @@ void mark_as_variable(afl_state_t *afl, struct queue_entry *q) {
if (symlink(ldest, fn)) {
- s32 fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0600);
+ s32 fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, DEFAULT_PERMISSION);
if (fd < 0) { PFATAL("Unable to create '%s'", fn); }
close(fd);
@@ -300,7 +300,7 @@ void mark_as_redundant(afl_state_t *afl, struct queue_entry *q, u8 state) {
s32 fd;
- fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0600);
+ fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, DEFAULT_PERMISSION);
if (fd < 0) { PFATAL("Unable to create '%s'", fn); }
close(fd);
@@ -680,13 +680,17 @@ void cull_queue(afl_state_t *afl) {
}
- afl->top_rated[i]->favored = 1;
- ++afl->queued_favored;
+ if (!afl->top_rated[i]->favored) {
- if (afl->top_rated[i]->fuzz_level == 0 ||
- !afl->top_rated[i]->was_fuzzed) {
+ afl->top_rated[i]->favored = 1;
+ ++afl->queued_favored;
- ++afl->pending_favored;
+ if (afl->top_rated[i]->fuzz_level == 0 ||
+ !afl->top_rated[i]->was_fuzzed) {
+
+ ++afl->pending_favored;
+
+ }
}