diff options
| author | Oliver Kiddle <okiddle@yahoo.co.uk> | 2019-05-14 23:22:24 +0200 |
|---|---|---|
| committer | Oliver Kiddle <okiddle@yahoo.co.uk> | 2019-05-14 23:22:24 +0200 |
| commit | b5519b372beaa5b954e5db5a6098bce24ff088f9 (patch) | |
| tree | db649c87944716c9b607392efbc1c6520aa597bc | |
| parent | 44291: printf with argument specifier out of range for an int crashed the shell (diff) | |
| download | zsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.tar zsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.tar.gz zsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.tar.bz2 zsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.tar.lz zsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.tar.xz zsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.tar.zst zsh-b5519b372beaa5b954e5db5a6098bce24ff088f9.zip | |
44290: job number exceeding int range and wrapping to a negative number crashed the shell
| -rw-r--r-- | ChangeLog | 3 | ||||
| -rw-r--r-- | Src/jobs.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,8 @@ 2019-05-14 Oliver Kiddle <okiddle@yahoo.co.uk> + * 44290: Src/jobs.c: job number exceeding int range and wrapping + to a negative number crashed the shell. + * 44291: Src/builtin.c: printf with argument specifier out of range for an int crashed the shell. 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 |
