Skip to content

Commit 33441d9

Browse files
committed
libvncclient/tls_openssl: do not deref a NULL pointer
Happens in anonTLS mode where cred is NULL. re #347
1 parent 49880e3 commit 33441d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: libvncclient/tls_openssl.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ open_ssl_connection (rfbClient *client, int sockfd, rfbBool anonTLS, rfbCredenti
268268
SSL *ssl = NULL;
269269
int n, finished = 0;
270270
X509_VERIFY_PARAM *param;
271-
uint8_t verify_crls = cred->x509Credential.x509CrlVerifyMode;
271+
uint8_t verify_crls;
272272

273273
if (!(ssl_ctx = SSL_CTX_new(SSLv23_client_method())))
274274
{
@@ -281,6 +281,7 @@ open_ssl_connection (rfbClient *client, int sockfd, rfbBool anonTLS, rfbCredenti
281281
/* Setup verification if not anonymous */
282282
if (!anonTLS)
283283
{
284+
verify_crls = cred->x509Credential.x509CrlVerifyMode;
284285
if (cred->x509Credential.x509CACertFile)
285286
{
286287
if (!SSL_CTX_load_verify_locations(ssl_ctx, cred->x509Credential.x509CACertFile, NULL))

0 commit comments

Comments
 (0)