Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
libvncclient/tls_openssl: do not deref a NULL pointer
Happens in anonTLS mode where cred is NULL.

re #347
  • Loading branch information
bk138 committed Mar 6, 2020
1 parent 49880e3 commit 33441d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libvncclient/tls_openssl.c
Expand Up @@ -268,7 +268,7 @@ open_ssl_connection (rfbClient *client, int sockfd, rfbBool anonTLS, rfbCredenti
SSL *ssl = NULL;
int n, finished = 0;
X509_VERIFY_PARAM *param;
uint8_t verify_crls = cred->x509Credential.x509CrlVerifyMode;
uint8_t verify_crls;

if (!(ssl_ctx = SSL_CTX_new(SSLv23_client_method())))
{
Expand All @@ -281,6 +281,7 @@ open_ssl_connection (rfbClient *client, int sockfd, rfbBool anonTLS, rfbCredenti
/* Setup verification if not anonymous */
if (!anonTLS)
{
verify_crls = cred->x509Credential.x509CrlVerifyMode;
if (cred->x509Credential.x509CACertFile)
{
if (!SSL_CTX_load_verify_locations(ssl_ctx, cred->x509Credential.x509CACertFile, NULL))
Expand Down

0 comments on commit 33441d9

Please sign in to comment.