diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-05-17 09:34:33 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-05-17 09:34:33 +0200 |
commit | 675c30abc222e9cab57c3dccc365cc20d4f9f375 (patch) | |
tree | 8b997fdf00be561c97edc12231d226747ef5db47 | |
parent | 8132fe11b320b6c73bd5fc8de37dd1d6a8f9a8da (diff) |
openssl: get_cert_chain: fix NULL dereference
CID 1361815: Explicit null dereferenced (FORWARD_NULL)
-rw-r--r-- | lib/vtls/openssl.c | 8 |
1 files changed, 5 insertions, 3 deletions
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); |