]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
speed: range check the argument given to -multi for 1.1.1
authorPauli <pauli@openssl.org>
Tue, 26 Oct 2021 22:30:51 +0000 (08:30 +1000)
committerPauli <pauli@openssl.org>
Thu, 28 Oct 2021 08:08:21 +0000 (18:08 +1000)
Fixes #16899 for 1.1.1 branch.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16922)

apps/speed.c

index d4ae7ab7bfdedcc577f16afd18f7be6360b8ee9a..7f2d3165f9911d59d38a40ccfaa171dd4722f546 100644 (file)
@@ -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: