diff options
author | Sahana Prasad <sahana@redhat.com> | 2021-03-22 11:04:45 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-03-28 16:34:34 +1000 |
commit | f0800c7c226c60161b49d832c342453b735984b4 (patch) | |
tree | 0e6fdbb2cba61989507d3a83614f1716f03f5c93 /crypto/x509/x_pubkey.c | |
parent | a638fb9413b2fc3e5f9d1de3ff0dcc1ec6c78468 (diff) |
Allocates and initializes pubkey in X509_PUBKEY_dup()
Fixes #14617
Signed-off-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14642)
Diffstat (limited to 'crypto/x509/x_pubkey.c')
-rw-r--r-- | crypto/x509/x_pubkey.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c index b2c8e4c83e..e9fcf8ef56 100644 --- a/crypto/x509/x_pubkey.c +++ b/crypto/x509/x_pubkey.c @@ -209,7 +209,8 @@ X509_PUBKEY *X509_PUBKEY_dup(const X509_PUBKEY *a) { X509_PUBKEY *pubkey = NULL; - if (!x509_pubkey_ex_new(NULL, ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL)) + if (!x509_pubkey_ex_new((ASN1_VALUE **)&pubkey, + ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL)) || !x509_pubkey_set0_libctx(pubkey, a->libctx, a->propq) || (pubkey->algor = X509_ALGOR_dup(a->algor)) == NULL || (pubkey->public_key = ASN1_BIT_STRING_new()) == NULL |