Fix a stupid segfault caused by dereferencing a NULL ptr.

-Erik
This commit is contained in:
Eric Andersen 2001-05-08 04:25:46 +00:00
parent 45e92ba2ce
commit 0a36de0580
2 changed files with 4 additions and 0 deletions

2
hush.c
View File

@ -1162,6 +1162,8 @@ static void checkjobs()
remove_bg_job(pi); remove_bg_job(pi);
} }
} else { } else {
if(pi==NULL)
break;
/* child stopped */ /* child stopped */
pi->stopped_progs++; pi->stopped_progs++;
pi->progs[prognum].is_stopped = 1; pi->progs[prognum].is_stopped = 1;

View File

@ -1162,6 +1162,8 @@ static void checkjobs()
remove_bg_job(pi); remove_bg_job(pi);
} }
} else { } else {
if(pi==NULL)
break;
/* child stopped */ /* child stopped */
pi->stopped_progs++; pi->stopped_progs++;
pi->progs[prognum].is_stopped = 1; pi->progs[prognum].is_stopped = 1;