diff options
author | Rumata888 <isennovskiy@gmail.com> | 2020-11-12 01:13:57 +0300 |
---|---|---|
committer | Rumata888 <isennovskiy@gmail.com> | 2020-11-12 01:13:57 +0300 |
commit | 20a8a93fd193f7526f5e3d0cd1dfa43df9d2c4f6 (patch) | |
tree | 22a966878b62df1785880536b9f9724242055e42 /src | |
parent | 4c59c5234aec0469e4dd02561dbd84387bd53155 (diff) | |
download | afl++-20a8a93fd193f7526f5e3d0cd1dfa43df9d2c4f6.tar.gz |
Fixed symcc custom mutator
Diffstat (limited to 'src')
-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 735420c3..4b29672a 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 @@ -623,11 +626,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); |