Skip to content

Commit

Permalink
Corrected segfault in TLS SNI code with OpenSSL in the case that call…
Browse files Browse the repository at this point in the history
…backs are not used. (#315)
  • Loading branch information
MadAlexUK authored and dinhvh committed Dec 7, 2018
1 parent b84742d commit 565b73b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data-types/mailstream_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ static struct mailstream_ssl_data * ssl_data_new_full(int fd, time_t timeout,
goto free_ctx;

#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
if (ssl_context->server_name != NULL) {
if (ssl_context != NULL && ssl_context->server_name != NULL) {
SSL_set_tlsext_host_name(ssl_conn, ssl_context->server_name);
free(ssl_context->server_name);
ssl_context->server_name = NULL;
Expand Down

0 comments on commit 565b73b

Please sign in to comment.