Skip to content

Commit

Permalink
Check that async_jobs is not negative and not too high.
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
(Merged from openssl/openssl#2693)
  • Loading branch information
bernd-edlinger authored and Rich Salz committed Mar 1, 2017
1 parent 607c926 commit f8aa157
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/speed.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ int speed_main(int argc, char **argv)
#ifndef NO_FORK
int multi = 0;
#endif
int async_jobs = 0;
unsigned int async_jobs = 0;
#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) \
|| !defined(OPENSSL_NO_EC)
long rsa_count = 1;
Expand Down Expand Up @@ -1393,6 +1393,12 @@ int speed_main(int argc, char **argv)
prog);
goto opterr;
}
if (async_jobs > 99999) {
BIO_printf(bio_err,
"%s: too many async_jobs\n",
prog);
goto opterr;
}
#endif
break;
case OPT_MISALIGN:
Expand Down

0 comments on commit f8aa157

Please sign in to comment.