about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKuang-che Wu <kcwu@chromium.org>2021-10-11 15:47:20 +0800
committerKuang-che Wu <kcwu@chromium.org>2021-10-11 15:47:20 +0800
commita8844eaceb1df92635a327fc4edba082b102a2ff (patch)
treeade72938c3a59a115c5d9cedd3f82f06a7747753 /src
parentda865cbb9d289d0f782a1c33d85261903c60d624 (diff)
downloadafl++-a8844eaceb1df92635a327fc4edba082b102a2ff.tar.gz
afl-showmap don't create empty "-" file
Diffstat (limited to 'src')
-rw-r--r--src/afl-showmap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index 75b0ff99..a04c1f5b 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -242,9 +242,11 @@ static u32 write_results_to_file(afl_forkserver_t *fsrv, u8 *outfile) {
   if (cmin_mode &&
       (fsrv->last_run_timed_out || (!caa && child_crashed != cco))) {
 
-    // create empty file to prevent error messages in afl-cmin
-    fd = open(outfile, O_WRONLY | O_CREAT | O_EXCL, DEFAULT_PERMISSION);
-    close(fd);
+    if (strcmp(outfile, "-")) {
+      // create empty file to prevent error messages in afl-cmin
+      fd = open(outfile, O_WRONLY | O_CREAT | O_EXCL, DEFAULT_PERMISSION);
+      close(fd);
+    }
     return ret;
 
   }