Never exit the fuzzer until h2o ended up closing the fd internally.
@@ -126,7 +126,6 @@ struct writer_thread_arg {
char *buf;
size_t len;
int fd;
- int ofd;
pthread_barrier_t barrier;
};
@@ -227,7 +226,6 @@ void *writer_thread(void *arg)
}
}
close(wta->fd);
- close(wta->ofd);
pthread_barrier_wait(&wta->barrier);
free(wta);
}
@@ -247,7 +245,6 @@ static int feeder(int sfd, char *buf, size_t len, pthread_barrier_t **barrier)
wta = (struct writer_thread_arg *)malloc(sizeof(*wta));
wta->fd = pair[0];
- wta->ofd = pair[1];
wta->buf = buf;
wta->len = len;
pthread_barrier_init(&wta->barrier, NULL, 2);
@@ -344,8 +341,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
}
/* Loop until the connection is closed by the client or server */
- while (is_valid_fd(c) && h2o_evloop_run(ctx.loop, 10))
- ;
+ while (is_valid_fd(c)) {
+ h2o_evloop_run(ctx.loop, 10);
+ }
pthread_barrier_wait(end);
pthread_barrier_destroy(end);
