]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Allocates and initializes pubkey in X509_PUBKEY_dup()
authorSahana Prasad <sahana@redhat.com>
Mon, 22 Mar 2021 10:04:45 +0000 (11:04 +0100)
committerPauli <pauli@openssl.org>
Sun, 28 Mar 2021 06:34:34 +0000 (16:34 +1000)
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)

crypto/x509/x_pubkey.c

index b2c8e4c83edef2424a01242ac85b15c5e6955ab5..e9fcf8ef56d2ba40943aa1262ad78e46573dddc1 100644 (file)
@@ -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