diff options
author | Sergio Paganoni <sergio.paganoni@gmail.com> | 2020-08-24 21:18:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 21:18:51 +0200 |
commit | 1efc6e59b7cd2a3623ad3d75622e8bf107b3dc98 (patch) | |
tree | 6d844328f0a03b820e98bb41ecf54443e2d8e991 /src/afl-fuzz-init.c | |
parent | 19eddbb0c76406db6d790681ef519c4d91e8814e (diff) | |
download | afl++-1efc6e59b7cd2a3623ad3d75622e8bf107b3dc98.tar.gz |
Added out_file value when using stdio (#524)
Diffstat (limited to 'src/afl-fuzz-init.c')
-rw-r--r-- | src/afl-fuzz-init.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c index 350a8599..7b7ba006 100644 --- a/src/afl-fuzz-init.c +++ b/src/afl-fuzz-init.c @@ -1841,24 +1841,21 @@ void setup_cmdline_file(afl_state_t *afl, char **argv) { void setup_stdio_file(afl_state_t *afl) { - u8 *fn; if (afl->file_extension) { - fn = alloc_printf("%s/.cur_input.%s", afl->tmp_dir, afl->file_extension); + afl->fsrv.out_file = alloc_printf("%s/.cur_input.%s", afl->tmp_dir, afl->file_extension); } else { - fn = alloc_printf("%s/.cur_input", afl->tmp_dir); + afl->fsrv.out_file = alloc_printf("%s/.cur_input", afl->tmp_dir); } - unlink(fn); /* Ignore errors */ + unlink(afl->fsrv.out_file); /* Ignore errors */ - afl->fsrv.out_fd = open(fn, O_RDWR | O_CREAT | O_EXCL, 0600); + afl->fsrv.out_fd = open(afl->fsrv.out_file, O_RDWR | O_CREAT | O_EXCL, 0600); - if (afl->fsrv.out_fd < 0) { PFATAL("Unable to create '%s'", fn); } - - ck_free(fn); + if (afl->fsrv.out_fd < 0) { PFATAL("Unable to create '%s'", afl->fsrv.out_file); } } |