diff options
Diffstat (limited to 'Src/jobs.c')
-rw-r--r-- | Src/jobs.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/jobs.c b/Src/jobs.c index ddd997c49..0464d18d8 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -209,7 +209,13 @@ findproc(pid_t pid, Job *jptr, Process *pptr, int aux) int hasprocs(int job) { - Job jn = jobtab + job; + Job jn; + + if (job < 0) { + DPUTS(1, "job number invalid in hasprocs"); + return 0; + } + jn = jobtab + job; return jn->procs || jn->auxprocs; } |