From fea13a17d849e6db94c553811423aa98017a2c77 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 21 Mar 2015 16:47:22 +0100 Subject: gtls: dereferencing NULL pointer Coverity CID 1291165 pointed out 'chainp' could be dereferenced when NULL if gnutls_certificate_get_peers() had previously failed. --- lib/vtls/gtls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/vtls') diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index d6293e506..82c09bc80 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -838,7 +838,7 @@ gtls_connect_step3(struct connectdata *conn, infof(data, "\t common name: WARNING couldn't obtain\n"); } - if(data->set.ssl.certinfo) { + if(data->set.ssl.certinfo && chainp) { unsigned int i; result = Curl_ssl_init_certinfo(data, cert_list_size); -- cgit v1.2.3