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>
This commit is contained in:
parent
c0c11afaf1
commit
97efe70b60
1 changed files with 3 additions and 0 deletions
|
@ -1368,6 +1368,9 @@ static int tls_verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx)
|
||||||
const char *err_str;
|
const char *err_str;
|
||||||
|
|
||||||
err_cert = X509_STORE_CTX_get_current_cert(x509_ctx);
|
err_cert = X509_STORE_CTX_get_current_cert(x509_ctx);
|
||||||
|
if (!err_cert)
|
||||||
|
return 0;
|
||||||
|
|
||||||
err = X509_STORE_CTX_get_error(x509_ctx);
|
err = X509_STORE_CTX_get_error(x509_ctx);
|
||||||
depth = X509_STORE_CTX_get_error_depth(x509_ctx);
|
depth = X509_STORE_CTX_get_error_depth(x509_ctx);
|
||||||
ssl = X509_STORE_CTX_get_ex_data(x509_ctx,
|
ssl = X509_STORE_CTX_get_ex_data(x509_ctx,
|
||||||
|
|
Loading…
Reference in a new issue