Skip to content

Commit 3736c7a

Browse files
committed
mod_ssl: Check SSL_CTX_new() return value
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
1 parent 3b6f3ae commit 3736c7a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/ssl/ssl_engine_init.c

+5
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,11 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
738738
TLS_server_method(); /* server */
739739
#endif
740740
ctx = SSL_CTX_new(method);
741+
if (ctx == NULL) {
742+
/* Can fail for some system/install mis-configuration. */
743+
ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
744+
return ssl_die(s);
745+
}
741746

742747
mctx->ssl_ctx = ctx;
743748

0 commit comments

Comments
 (0)