aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEytan Lifshitz <eytan.lifshitz@intel.com>2014-02-10 10:55:08 (GMT)
committerJouni Malinen <j@w1.fi>2014-02-13 13:58:21 (GMT)
commit97efe70b60755a87cfe14d9475c4e90b4acb9145 (patch)
tree9cbb080960c6fc539dd7b5e14102de433d7c336d /src
parentc0c11afaf1467e74769acc96344255c7828415b4 (diff)
downloadhostap-97efe70b60755a87cfe14d9475c4e90b4acb9145.zip
hostap-97efe70b60755a87cfe14d9475c4e90b4acb9145.tar.gz
hostap-97efe70b60755a87cfe14d9475c4e90b4acb9145.tar.bz2
wpa_supplicant: Fix NULL dereference in tls_verify_cb()
In function tls_verify_cb(), X509_STORE_CTX_get_current_cert() may return NULL, and it will be dereferenced by X509_get_subject_name(). Signed-hostap: Eytan Lifshitz <eytan.lifshitz@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/crypto/tls_openssl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index d025ae0..a13fa38 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -1368,6 +1368,9 @@ static int tls_verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx)
const char *err_str;
err_cert = X509_STORE_CTX_get_current_cert(x509_ctx);
+ if (!err_cert)
+ return 0;
+
err = X509_STORE_CTX_get_error(x509_ctx);
depth = X509_STORE_CTX_get_error_depth(x509_ctx);
ssl = X509_STORE_CTX_get_ex_data(x509_ctx,