summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2017-02-21 06:58:04 +0100
committerRich Salz <rsalz@openssl.org>2017-03-01 12:27:36 -0500
commit4cdf91ef7d6cd05706027c341d36db867276ea47 (patch)
tree526baa59012768bef91439ce346393a821caaad1 /apps
parent1c78765f2dcc0d30bcc1ac279cc03cb388808c95 (diff)
Check that async_jobs is not negative and not too high.
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2693) (cherry picked from commit f8aa15728ba960137faf77b298fa60c1e63dc50f)
Diffstat (limited to 'apps')
-rw-r--r--apps/speed.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/speed.c b/apps/speed.c
index df22422ea8..ad2daab1c1 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -1235,7 +1235,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;
@@ -1414,6 +1414,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: