From 675c30abc222e9cab57c3dccc365cc20d4f9f375 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 17 May 2016 09:34:33 +0200 Subject: openssl: get_cert_chain: fix NULL dereference CID 1361815: Explicit null dereferenced (FORWARD_NULL) --- lib/vtls/openssl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/vtls') diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 93373e03d..fea0dfe4f 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2550,9 +2550,11 @@ static CURLcode get_cert_chain(struct connectdata *conn, EVP_PKEY_free(pubkey); } - for(j = 0; j < psig->length; j++) - BIO_printf(mem, "%02x:", psig->data[j]); - push_certinfo("Signature", i); + if(psig) { + for(j = 0; j < psig->length; j++) + BIO_printf(mem, "%02x:", psig->data[j]); + push_certinfo("Signature", i); + } PEM_write_bio_X509(mem, x); push_certinfo("Cert", i); -- cgit v1.2.3