From ce5e7f9c52efb77bc0034dfeefa8f5f245e08117 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sun, 29 Jan 2006 17:21:56 +0000 Subject: [PATCH] Fixed segfault when cert data is NULL. --- src/net/tls/TLSSocket.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/net/tls/TLSSocket.cpp b/src/net/tls/TLSSocket.cpp index 93066b98..18bb7b9c 100644 --- a/src/net/tls/TLSSocket.cpp +++ b/src/net/tls/TLSSocket.cpp @@ -286,6 +286,9 @@ ref 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];