]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TLS client: Fix peer certificate event checking for probing
authorJouni Malinen <j@w1.fi>
Sat, 9 Feb 2019 14:10:47 +0000 (16:10 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 9 Feb 2019 23:43:50 +0000 (01:43 +0200)
conn->cred might be NULL here, so check for that explicitly before
checking whether conn->cred->cert_probe is set. This fixes a potential
NULL pointer dereference when going through peer certificates with
event_cb functionality enabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/tls/tlsv1_client_read.c

index e66f1a98896def30c76dde256d5365f979f0417d..80874e59d1de52c99a03cd6f1be645f00ffc2e99 100644 (file)
@@ -290,7 +290,7 @@ static void tls_peer_cert_event(struct tlsv1_client *conn, int depth,
                return;
 
        os_memset(&ev, 0, sizeof(ev));
-       if (conn->cred->cert_probe || conn->cert_in_cb) {
+       if ((conn->cred && conn->cred->cert_probe) || conn->cert_in_cb) {
                cert_buf = wpabuf_alloc_copy(cert->cert_start,
                                             cert->cert_len);
                ev.peer_cert.cert = cert_buf;