about summary refs log tree commit diff
path: root/Src/jobs.c
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2019-05-14 23:22:24 +0200
committerOliver Kiddle <okiddle@yahoo.co.uk>2019-05-14 23:22:24 +0200
commitb5519b372beaa5b954e5db5a6098bce24ff088f9 (patch)
treedb649c87944716c9b607392efbc1c6520aa597bc /Src/jobs.c
parentd66fd7fcf503b0b8a96b9aafc7263de9886a661e (diff)
downloadzsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.tar.gz
zsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.tar.xz
zsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.zip
44290: job number exceeding int range and wrapping to a negative number crashed the shell
Diffstat (limited to 'Src/jobs.c')
-rw-r--r--Src/jobs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 73d7f26da..50751decb 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1932,7 +1932,7 @@ getjob(const char *s, const char *prog)
     /* a digit here means we have a job number */
     if (idigit(*s)) {
 	jobnum = atoi(s);
-	if (jobnum && jobnum <= mymaxjob && myjobtab[jobnum].stat &&
+	if (jobnum > 0 && jobnum <= mymaxjob && myjobtab[jobnum].stat &&
 	    !(myjobtab[jobnum].stat & STAT_SUBJOB) &&
 	    /*
 	     * If running jobs in a subshell, we are allowed to