Skip to content
Snippets Groups Projects
Commit 16cde63e authored by Tobias Klauser's avatar Tobias Klauser Committed by Herbert Xu
Browse files

jobs: Don't attempt to access job table for job %0


If job %0 is (mistakenly) specified, an out-of-bounds access to the
jobtab occurs in function getjob() if num = 0:

	jp = jobtab + 0 - 1

Fix this by checking that the job number is larger than 0 before
accessing the jobtab.

Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 0134f725
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -699,7 +699,7 @@ check:
 
if (is_number(p)) {
num = atoi(p);
if (num <= njobs) {
if (num > 0 && num <= njobs) {
jp = jobtab + num - 1;
if (jp->used)
goto gotit;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment