afl-showmap don't create empty "-" file

This commit is contained in:
Kuang-che Wu
2021-10-11 15:47:20 +08:00
parent da865cbb9d
commit a8844eaceb

View File

@ -242,9 +242,11 @@ static u32 write_results_to_file(afl_forkserver_t *fsrv, u8 *outfile) {
if (cmin_mode && if (cmin_mode &&
(fsrv->last_run_timed_out || (!caa && child_crashed != cco))) { (fsrv->last_run_timed_out || (!caa && child_crashed != cco))) {
// create empty file to prevent error messages in afl-cmin if (strcmp(outfile, "-")) {
fd = open(outfile, O_WRONLY | O_CREAT | O_EXCL, DEFAULT_PERMISSION); // create empty file to prevent error messages in afl-cmin
close(fd); fd = open(outfile, O_WRONLY | O_CREAT | O_EXCL, DEFAULT_PERMISSION);
close(fd);
}
return ret; return ret;
} }