From: Ruediger Pluem Date: Fri, 10 Oct 2014 17:54:33 +0000 (+0000) Subject: * Check if we are having an SSL connection before looking up SSL related X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=991e45e44874798d70bc4c52d0276b1809ea74c1;p=thirdparty%2Fapache%2Fhttpd.git * Check if we are having an SSL connection before looking up SSL related variables during expression evaluation to avoid a crash. If not return an empty string. PR: 57070 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1630947 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index c1db503d40e..52e6ad41286 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_ssl: Do not crash when looking up SSL related variables during + expression evaluation on non SSL connections. PR 57070 [Ruediger Pluem] + *) core: Ensure that httpd exits with an error status when the MPM fails to run. [Yann Ylavic] diff --git a/modules/ssl/ssl_engine_vars.c b/modules/ssl/ssl_engine_vars.c index fa0b0e1fe14..be55ba31d9b 100644 --- a/modules/ssl/ssl_engine_vars.c +++ b/modules/ssl/ssl_engine_vars.c @@ -142,7 +142,9 @@ static apr_array_header_t *expr_peer_ext_list_fn(ap_expr_eval_ctx_t *ctx, static const char *expr_var_fn(ap_expr_eval_ctx_t *ctx, const void *data) { char *var = (char *)data; - return ssl_var_lookup_ssl(ctx->p, ctx->c, ctx->r, var); + SSLConnRec *sslconn = myConnConfig(ctx->c); + + return sslconn ? ssl_var_lookup_ssl(ctx->p, ctx->c, ctx->r, var) : ""; } static int ssl_expr_lookup(ap_expr_lookup_parms *parms)