diff options
author | hexcoder- <heiko@hexco.de> | 2021-05-01 14:03:28 +0200 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2021-05-01 14:03:28 +0200 |
commit | 6119c2eb5f4349c93abbeb19f0f9ec2f41aaabd1 (patch) | |
tree | 8f281c56c953bb8c18aef5a21f466c99b49cb8f1 | |
parent | c6e8314446344d3a65b828feb31f627ce11ba352 (diff) | |
download | afl++-6119c2eb5f4349c93abbeb19f0f9ec2f41aaabd1.tar.gz |
remove the input file .cur_input at the end of the fuzzing, if AFL_TMPDIR is used
m--------- | qemu_mode/qemuafl | 0 | ||||
-rw-r--r-- | src/afl-fuzz.c | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/qemu_mode/qemuafl b/qemu_mode/qemuafl -Subproject d73b0336b451fd034e5f469089fb7ee96c80adf +Subproject ddc4a9748d59857753fb33c30a356f354595f36 diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c index 1b3e303c..8c3ba575 100644 --- a/src/afl-fuzz.c +++ b/src/afl-fuzz.c @@ -2212,6 +2212,31 @@ stop_fuzzing: } afl_fsrv_deinit(&afl->fsrv); + + /* remove tmpfile */ + if (afl->tmp_dir != NULL && !afl->in_place_resume) { + + char tmpfile[PATH_MAX]; + + if (afl->file_extension) { + + snprintf(tmpfile, PATH_MAX, "%s/.cur_input.%s", afl->tmp_dir, + afl->file_extension); + + } else { + + snprintf(tmpfile, PATH_MAX, "%s/.cur_input", afl->tmp_dir); + + } + + if (unlink(tmpfile) != 0) { + + FATAL("Could not unlink current input file: %s.", tmpfile); + + } + + } + if (afl->orig_cmdline) { ck_free(afl->orig_cmdline); } ck_free(afl->fsrv.target_path); ck_free(afl->fsrv.out_file); |