Fixed segfault when cert data is NULL.

This commit is contained in:
Vincent Richard 2006-01-29 17:21:56 +00:00
parent db43d8bab5
commit ce5e7f9c52

View File

@ -286,6 +286,9 @@ ref <security::cert::certificateChain> TLSSocket::getPeerCertificates()
const gnutls_datum* rawData = gnutls_certificate_get_peers
(*m_session->m_gnutlsSession, &certCount);
if (rawData == NULL)
return NULL;
// Try X.509
gnutls_x509_crt* x509Certs = new gnutls_x509_crt[certCount];