From: Daniel Stenberg Date: Tue, 17 May 2016 07:14:06 +0000 (+0200) Subject: openssl: get_cert_chain: avoid NULL dereference X-Git-Tag: curl-7_49_0~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8132fe11b320b6c73bd5fc8de37dd1d6a8f9a8da;p=curl openssl: get_cert_chain: avoid NULL dereference CID 1361811: Explicit null dereferenced (FORWARD_NULL) --- diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 6b70c0ccc..93373e03d 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2385,10 +2385,12 @@ static CURLcode get_cert_chain(struct connectdata *conn, X509_get0_signature(&psig, &palg, x); X509_signature_print(mem, palg, a); ASN1_STRING_free(a); - } - i2a_ASN1_OBJECT(mem, palg->algorithm); - push_certinfo("Public Key Algorithm", i); + if(palg) { + i2a_ASN1_OBJECT(mem, palg->algorithm); + push_certinfo("Public Key Algorithm", i); + } + } X509V3_ext(data, i, X509_get0_extensions(x)); } #else