Commit 28a00bcd authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Check public key is not NULL.

CVE-2015-0288
PR#3708

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
parent 437b14b5
Loading
Loading
Loading
Loading
+2 −0
Changes for crypto/x509/x509_req.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
        goto err;

    pktmp = X509_get_pubkey(x);
    if (pktmp == NULL)
        goto err;
    i = X509_REQ_set_pubkey(ret, pktmp);
    EVP_PKEY_free(pktmp);
    if (!i)