gtls: dereferencing NULL pointer

Coverity CID 1291165 pointed out 'chainp' could be dereferenced when
NULL if gnutls_certificate_get_peers() had previously failed.
This commit is contained in:
Daniel Stenberg 2015-03-21 16:47:22 +01:00
parent 5f6f9e8b59
commit fea13a17d8

View File

@ -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);