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 | |
parent | 15500c9d08dc51e67b5afb7de058258e244fe7f9 (diff) | |
download | openssl-89fe295257f374647122f73776ddb34555c543f0.zip openssl-89fe295257f374647122f73776ddb34555c543f0.tar.gz openssl-89fe295257f374647122f73776ddb34555c543f0.tar.bz2 |
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')
-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 b68530f..e9a45e4 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); |