From 886e6855c3fd5ea977b36afea5a2aa31b7cdd01c Mon Sep 17 00:00:00 2001 From: Pauli Date: Wed, 27 Oct 2021 08:30:51 +1000 Subject: [PATCH] speed: range check the argument given to -multi for 1.1.1 Fixes #16899 for 1.1.1 branch. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/16922) --- apps/speed.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/speed.c b/apps/speed.c index d4ae7ab7bfd..7f2d3165f99 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -1590,6 +1590,10 @@ int speed_main(int argc, char **argv) case OPT_MULTI: #ifndef NO_FORK multi = atoi(opt_arg()); + if (multi >= INT_MAX / (int)sizeof(int)) { + BIO_printf(bio_err, "%s: multi argument too large\n", prog); + return 0; + } #endif break; case OPT_ASYNCJOBS: -- 2.47.2