Skip to content

Commit

Permalink
Don't crash on addservername failure
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB authored Dec 28, 2023
1 parent bb86c9c commit a15d9bb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/crypto/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,13 @@ void us_internal_ssl_socket_context_add_server_name(struct us_internal_ssl_socke
SSL_CTX *ssl_context = create_ssl_context_from_options(options);

/* Attach the user data to this context */
if (1 != SSL_CTX_set_ex_data(ssl_context, 0, user)) {
printf("CANNOT SET EX DATA!\n");
}

/* We do not want to hold any nullptr's in our SNI tree */
if (ssl_context) {
if (1 != SSL_CTX_set_ex_data(ssl_context, 0, user)) {
printf("CANNOT SET EX DATA!\n");
}

/* We do not want to hold any nullptr's in our SNI tree */

if (sni_add(context->sni, hostname_pattern, ssl_context)) {
/* If we already had that name, ignore */
free_ssl_context(ssl_context);
Expand Down

0 comments on commit a15d9bb

Please sign in to comment.