Skip to content
Snippets Groups Projects
Commit 33a1e905 authored by Diana Ren's avatar Diana Ren Committed by Andy Green
Browse files

client: opesssl: also check wsi for NULL on non-error path

same change as a58b3892 in other code path - check wsi before
 accessing and return 0 (not ok) if null
parent b84f3e50
Branches
Tags
No related merge requests found
...@@ -77,6 +77,10 @@ OpenSSL_client_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) ...@@ -77,6 +77,10 @@ OpenSSL_client_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx)
ssl = X509_STORE_CTX_get_ex_data(x509_ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); ssl = X509_STORE_CTX_get_ex_data(x509_ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
wsi = SSL_get_ex_data(ssl, openssl_websocket_private_data_index); wsi = SSL_get_ex_data(ssl, openssl_websocket_private_data_index);
if (!wsi) {
lwsl_err("can't retrieve wsi from ssl private data");
return 0;
}
n = lws_get_context_protocol(wsi->context, 0).callback(wsi, n = lws_get_context_protocol(wsi->context, 0).callback(wsi,
LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION, LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment