Skip to content

Commit

Permalink
mod_ssl: Check SSL_CTX_new() return value
Browse files Browse the repository at this point in the history
SSL_CTX_new() will return NULL if there was an error creating a new SSL context.

Submitted by: StephenWall
Github: closes #402


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916054 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
notroj committed Feb 29, 2024
1 parent 3b6f3ae commit 3736c7a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/ssl/ssl_engine_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,11 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
TLS_server_method(); /* server */
#endif
ctx = SSL_CTX_new(method);
if (ctx == NULL) {
/* Can fail for some system/install mis-configuration. */
ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
return ssl_die(s);
}

mctx->ssl_ctx = ctx;

Expand Down

0 comments on commit 3736c7a

Please sign in to comment.