fix timeout bug in afl tools

This commit is contained in:
vanhauser-thc
2021-10-23 20:54:24 +02:00
parent 06b23c7dcb
commit e03897a070
5 changed files with 43 additions and 4 deletions

View File

@ -146,6 +146,17 @@ static const u8 count_class_binary[256] = {
#undef TIMES8
#undef TIMES4
static void kill_child() {
if (fsrv->child_pid > 0) {
kill(fsrv->child_pid, fsrv->kill_signal);
fsrv->child_pid = -1;
}
}
static void classify_counts(afl_forkserver_t *fsrv) {
u8 * mem = fsrv->trace_bits;
@ -526,6 +537,8 @@ static void showmap_run_target(afl_forkserver_t *fsrv, char **argv) {
}
signal(SIGALRM, kill_child);
setitimer(ITIMER_REAL, &it, NULL);
if (waitpid(fsrv->child_pid, &status, 0) <= 0) { FATAL("waitpid() failed"); }