TLS: Make tls_cert_chain_failure_event() more robust
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 28 Dec 2015 16:31:11 +0000 (18:31 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 28 Dec 2015 16:31:11 +0000 (18:31 +0200)
Explicitly check for the failure event to include a certificate before
trying to build the event.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/tls/tlsv1_client_read.c

index 89ef196..244c3cb 100644 (file)
@@ -326,7 +326,7 @@ static void tls_cert_chain_failure_event(struct tlsv1_client *conn, int depth,
        union tls_event_data ev;
        char subject[128];
 
-       if (!conn->event_cb)
+       if (!conn->event_cb || !cert)
                return;
 
        os_memset(&ev, 0, sizeof(ev));