diff options
author | Christian Heimes <christian@python.org> | 2021-06-24 17:47:30 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-06-26 11:40:34 +1000 |
commit | 89fe295257f374647122f73776ddb34555c543f0 (patch) | |
tree | aba5bd6a4b59d21d5d0a99d01e9f9b180c9d5ff7 /apps/x509.c | |
parent | 15500c9d08dc51e67b5afb7de058258e244fe7f9 (diff) |
Fix segfault in openssl x509 -modulus
The command ``openssl x509 -noout -modulus -in cert.pem`` used to segfaults
sometimes because an uninitialized variable was passed to
``BN_lebin2bn``. The bug triggered an assertion in bn_expand_internal().
Fixes: https://github.com/openssl/openssl/issues/15899
Signed-off-by: Christian Heimes <christian@python.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15900)
Diffstat (limited to 'apps/x509.c')
-rw-r--r-- | apps/x509.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/x509.c b/apps/x509.c index b68530fb22..e9a45e4d8f 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -943,7 +943,7 @@ int x509_main(int argc, char **argv) } else if (i == modulus) { BIO_printf(out, "Modulus="); if (EVP_PKEY_is_a(pkey, "RSA")) { - BIGNUM *n; + BIGNUM *n = NULL; /* Every RSA key has an 'n' */ EVP_PKEY_get_bn_param(pkey, "n", &n); |