From: Bernd Edlinger Date: Tue, 21 Feb 2017 05:58:04 +0000 (+0100) Subject: Check that async_jobs is not negative and not too high. X-Git-Tag: OpenSSL_1_1_1-pre1~2196 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f8aa15728ba960137faf77b298fa60c1e63dc50f;p=oweals%2Fopenssl.git Check that async_jobs is not negative and not too high. Reviewed-by: Matt Caswell Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2693) --- diff --git a/apps/speed.c b/apps/speed.c index c10a8ee197..50522ae25a 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -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; @@ -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: