diff options
author | hexcoder- <heiko@hexco.de> | 2019-09-23 21:59:27 +0200 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2019-09-23 21:59:27 +0200 |
commit | d13592aea0553b18ecf5366a260b3d5d3fe91764 (patch) | |
tree | 751b631cf044ec3804103abf99a8d89719759d36 /src/afl-fuzz-run.c | |
parent | 59d4b0aadb11c893d10a838fa5795286d3fd7264 (diff) | |
parent | 96c9fa0ccc4cc9b3db3e448fd685484fd271ca98 (diff) | |
download | afl++-d13592aea0553b18ecf5366a260b3d5d3fe91764.tar.gz |
Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus
Diffstat (limited to 'src/afl-fuzz-run.c')
-rw-r--r-- | src/afl-fuzz-run.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c index f2f663dc..220433fc 100644 --- a/src/afl-fuzz-run.c +++ b/src/afl-fuzz-run.c @@ -251,6 +251,18 @@ void write_to_testcase(void* mem, u32 len) { s32 fd = out_fd; +#ifdef _AFL_DOCUMENT_MUTATIONS + s32 doc_fd; + char *fn = alloc_printf("%s/mutations/%09u:%s", out_dir, document_counter++, describe_op(0)); + if (fn != NULL) { + if ((doc_fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600)) >= 0) { + if (write(doc_fd, mem, len) != len) PFATAL("write to mutation file failed: %s", fn); + close(doc_fd); + } + ck_free(fn); + } +#endif + if (out_file) { // unlink(out_file); /* Ignore errors. |