about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-10-11 09:59:45 +0200
committerGitHub <noreply@github.com>2021-10-11 09:59:45 +0200
commit9c1eb51e5cf0c2703c2a83c9289394fbcb634c0b (patch)
tree05e251e0945512d281ede49b5fc8e3332db8a222 /src
parent989f0d00a5d9cfd047d78d831be3878d4cf04131 (diff)
parenta8844eaceb1df92635a327fc4edba082b102a2ff (diff)
downloadafl++-9c1eb51e5cf0c2703c2a83c9289394fbcb634c0b.tar.gz
Merge pull request #1112 from kcwu/dev
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;
 
   }