diff options
author | van Hauser <vh@thc.org> | 2023-01-27 11:46:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 11:46:59 +0100 |
commit | 3e8a691a81c08c174467e3d7ae04328a4d6be29e (patch) | |
tree | dcb91017e71b3390e8387d7295ee13012dba344b /src/afl-fuzz-init.c | |
parent | 3b6fcd911a860a8c823c912c4b08b423734e4cfe (diff) | |
parent | 33eba1fc5652060e8d877b02135fce2325813d0c (diff) | |
download | afl++-3e8a691a81c08c174467e3d7ae04328a4d6be29e.tar.gz |
Merge pull request #1627 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-fuzz-init.c')
-rw-r--r-- | src/afl-fuzz-init.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c index adfc55ad..1182bd41 100644 --- a/src/afl-fuzz-init.c +++ b/src/afl-fuzz-init.c @@ -1817,17 +1817,35 @@ static void handle_existing_out_dir(afl_state_t *afl) { if (afl->file_extension) { - fn = alloc_printf("%s/.cur_input.%s", afl->tmp_dir, afl->file_extension); + fn = alloc_printf("%s/.cur_input.%s", afl->out_dir, afl->file_extension); } else { - fn = alloc_printf("%s/.cur_input", afl->tmp_dir); + fn = alloc_printf("%s/.cur_input", afl->out_dir); } if (unlink(fn) && errno != ENOENT) { goto dir_cleanup_failed; } ck_free(fn); + if (afl->afl_env.afl_tmpdir) { + + if (afl->file_extension) { + + fn = alloc_printf("%s/.cur_input.%s", afl->afl_env.afl_tmpdir, + afl->file_extension); + + } else { + + fn = alloc_printf("%s/.cur_input", afl->afl_env.afl_tmpdir); + + } + + if (unlink(fn) && errno != ENOENT) { goto dir_cleanup_failed; } + ck_free(fn); + + } + fn = alloc_printf("%s/fuzz_bitmap", afl->out_dir); if (unlink(fn) && errno != ENOENT) { goto dir_cleanup_failed; } ck_free(fn); |