diff options
author | van Hauser <vh@thc.org> | 2020-11-17 10:13:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 10:13:57 +0100 |
commit | 99c783821f23d39da4f770147bf8d78ea1781cee (patch) | |
tree | db1390ee88eb12f0a8f0f21ba18ad0daf239c319 /src/afl-fuzz-bitmap.c | |
parent | 1cc637a0a05a043a223f69fb9661ecc3d5597d23 (diff) | |
parent | 9d22c8a02ca9043e62c250a32d5affdaeab11dcd (diff) | |
download | afl++-99c783821f23d39da4f770147bf8d78ea1781cee.tar.gz |
Merge pull request #601 from Rumata888/fixing_symcc
Fixing symcc custom mutator
Diffstat (limited to 'src/afl-fuzz-bitmap.c')
-rw-r--r-- | src/afl-fuzz-bitmap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/afl-fuzz-bitmap.c b/src/afl-fuzz-bitmap.c index a4407af7..2d14b04e 100644 --- a/src/afl-fuzz-bitmap.c +++ b/src/afl-fuzz-bitmap.c @@ -584,7 +584,10 @@ save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) { alloc_printf("%s/queue/id_%06u", afl->out_dir, afl->queued_paths); #endif /* ^!SIMPLE_FILES */ - + fd = open(queue_fn, O_WRONLY | O_CREAT | O_EXCL, 0600); + if (unlikely(fd < 0)) { PFATAL("Unable to create '%s'", queue_fn); } + ck_write(fd, mem, len, queue_fn); + close(fd); add_to_queue(afl, queue_fn, len, 0); #ifdef INTROSPECTION @@ -647,11 +650,6 @@ save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) { } - fd = open(queue_fn, O_WRONLY | O_CREAT | O_EXCL, 0600); - if (unlikely(fd < 0)) { PFATAL("Unable to create '%s'", queue_fn); } - ck_write(fd, mem, len, queue_fn); - close(fd); - if (likely(afl->q_testcase_max_cache_size)) { queue_testcase_store_mem(afl, afl->queue_top, mem); |