diff options
author | van Hauser <vh@thc.org> | 2020-09-04 17:04:42 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-09-04 17:04:42 +0200 |
commit | 6c715f1a69f91d4336023a8ba10fb4a7e126f9c2 (patch) | |
tree | 2b19a7d912fde4936b4cc9cfe279a8858c0738f0 /src/afl-common.c | |
parent | fc19aa96f78cd33ce7d548bad5c7e4d3efa069d1 (diff) | |
download | afl++-6c715f1a69f91d4336023a8ba10fb4a7e126f9c2.tar.gz |
more changes to fuzzer_setup
Diffstat (limited to 'src/afl-common.c')
-rw-r--r-- | src/afl-common.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/afl-common.c b/src/afl-common.c index 367dec72..d66440aa 100644 --- a/src/afl-common.c +++ b/src/afl-common.c @@ -877,3 +877,36 @@ u32 get_map_size(void) { } +/* Create a stream file */ + +FILE *create_ffile(u8 *fn) { + + s32 fd; + FILE *f; + + fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600); + + if (fd < 0) { PFATAL("Unable to create '%s'", fn); } + + f = fdopen(fd, "w"); + + if (!f) { PFATAL("fdopen() failed"); } + + return f; + +} + +/* Create a file */ + +s32 create_file(u8 *fn) { + + s32 fd; + + fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600); + + if (fd < 0) { PFATAL("Unable to create '%s'", fn); } + + return fd; + +} + |