diff options
author | vanhauser-thc <vh@thc.org> | 2024-04-25 10:04:58 +0200 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2024-04-25 10:04:58 +0200 |
commit | 951a0e52254d873dd0f1a3a80d9acda44563edd5 (patch) | |
tree | e03f1950bfebb99a15153593602b097c919246a2 | |
parent | 458b939bc4f0ed4016c2741529435a72283ffc74 (diff) | |
download | afl++-951a0e52254d873dd0f1a3a80d9acda44563edd5.tar.gz |
fix AFL_PERSISTENT_RECORD
-rw-r--r-- | docs/Changelog.md | 2 | ||||
-rw-r--r-- | src/afl-forkserver.c | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md index 4e34baea..48c0ab06 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -4,6 +4,8 @@ release of the tool. See README.md for the general instruction manual. ### Version ++4.21a (dev) + * afl-fuzz + - fix AFL_PERSISTENT_RECORD * afl-cc: - fixes for LTO and outdated afl-gcc mode diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c index 149a973e..e5f64c81 100644 --- a/src/afl-forkserver.c +++ b/src/afl-forkserver.c @@ -27,6 +27,9 @@ */ #include "config.h" +#ifdef AFL_PERSISTENT_RECORD + #include "afl-fuzz.h" +#endif #include "types.h" #include "debug.h" #include "common.h" @@ -2078,10 +2081,13 @@ store_persistent_record: { u32 len = fsrv->persistent_record_len[entry]; if (likely(len && data)) { - snprintf(fn, sizeof(fn), persistent_out_fmt, fsrv->persistent_record_dir, - fsrv->persistent_record_cnt, writecnt++, - afl->file_extension ? "." : "", - afl->file_extension ? (const char *)afl->file_extension : ""); + snprintf( + fn, sizeof(fn), persistent_out_fmt, fsrv->persistent_record_dir, + fsrv->persistent_record_cnt, writecnt++, + ((afl_state_t *)(fsrv->afl_ptr))->file_extension ? "." : "", + ((afl_state_t *)(fsrv->afl_ptr))->file_extension + ? (const char *)((afl_state_t *)(fsrv->afl_ptr))->file_extension + : ""); int fd = open(fn, O_CREAT | O_TRUNC | O_WRONLY, 0644); if (fd >= 0) { |