This commit is contained in:
vanhauser-thc
2021-03-06 23:12:44 +01:00
parent 7f062524c9
commit 517db1b8dc
2 changed files with 3 additions and 2 deletions

View File

@ -1278,7 +1278,7 @@ fsrv_run_result_t afl_fsrv_run_target(afl_forkserver_t *fsrv, u32 timeout,
snprintf(fn, sizeof(fn), "%s/RECORD:%06u,cnt:%06u", snprintf(fn, sizeof(fn), "%s/RECORD:%06u,cnt:%06u",
fsrv->persistent_record_dir, fsrv->persistent_record_cnt, fsrv->persistent_record_dir, fsrv->persistent_record_cnt,
writecnt++); writecnt++);
int fd = open(fn, O_WRONLY, 0644); int fd = open(fn, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd >= 0) { if (fd >= 0) {
ck_write(fd, data, len, fn); ck_write(fd, data, len, fn);

View File

@ -989,7 +989,6 @@ int main(int argc, char **argv_orig, char **envp) {
if (unlikely(afl->afl_env.afl_persistent_record)) { if (unlikely(afl->afl_env.afl_persistent_record)) {
afl->fsrv.persistent_record = atoi(afl->afl_env.afl_persistent_record); afl->fsrv.persistent_record = atoi(afl->afl_env.afl_persistent_record);
afl->fsrv.persistent_record_dir = alloc_printf("%s/crashes", afl->out_dir);
if (afl->fsrv.persistent_record < 2) { if (afl->fsrv.persistent_record < 2) {
@ -1533,6 +1532,8 @@ int main(int argc, char **argv_orig, char **envp) {
} }
afl->fsrv.persistent_record_dir = alloc_printf("%s/crashes", afl->out_dir);
} }
if (afl->shmem_testcase_mode) { setup_testcase_shmem(afl); } if (afl->shmem_testcase_mode) { setup_testcase_shmem(afl); }