fsrv copy: out_fd = 0 on stdin

This commit is contained in:
van Hauser
2020-11-03 15:15:58 +01:00
parent 8bccf56553
commit 245f511a1d

View File

@ -113,7 +113,16 @@ void afl_fsrv_init_dup(afl_forkserver_t *fsrv_to, afl_forkserver_t *from) {
fsrv_to->child_pid = -1; fsrv_to->child_pid = -1;
fsrv_to->use_fauxsrv = 0; fsrv_to->use_fauxsrv = 0;
fsrv_to->last_run_timed_out = 0; fsrv_to->last_run_timed_out = 0;
fsrv_to->out_fd = -1;
if (fsrv_to->use_stdin) {
fsrv_to->out_fd = 0;
} else {
fsrv_to->out_fd = -1;
}
fsrv_to->init_child_func = fsrv_exec_child; fsrv_to->init_child_func = fsrv_exec_child;
// Note: do not copy ->add_extra_func // Note: do not copy ->add_extra_func