aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-02-09 14:10:47 (GMT)
committerJouni Malinen <j@w1.fi>2019-02-09 23:43:50 (GMT)
commitfdd8a2f0b85bb5e2a2f23484c306df9cb2a65b69 (patch)
treef050af3c46b069ac3942109d18e309b36327c841 /src/tls
parente5bffe1aa9e7324142bb70f6939487afd185ad31 (diff)
downloadhostap-fdd8a2f0b85bb5e2a2f23484c306df9cb2a65b69.zip
hostap-fdd8a2f0b85bb5e2a2f23484c306df9cb2a65b69.tar.gz
hostap-fdd8a2f0b85bb5e2a2f23484c306df9cb2a65b69.tar.bz2
TLS client: Fix peer certificate event checking for probing
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>
Diffstat (limited to 'src/tls')
-rw-r--r--src/tls/tlsv1_client_read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tls/tlsv1_client_read.c b/src/tls/tlsv1_client_read.c
index e66f1a9..80874e5 100644
--- a/src/tls/tlsv1_client_read.c
+++ b/src/tls/tlsv1_client_read.c
@@ -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;