You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2015/01/09 21:51:04 UTC

svn commit: r1650659 - in /httpd/httpd/branches/2.4.x: CHANGES STATUS modules/ssl/ssl_engine_vars.c

Author: jailletc36
Date: Fri Jan  9 20:51:03 2015
New Revision: 1650659

URL: http://svn.apache.org/r1650659
Log:
Merge r1630947, r1645670 from trunk

   * mod_ssl: Check if we are having an SSL connection before looking up SSL
              related variables during expression evaluation to avoid a crash.
              If not return NULL as ssl_var_lookup_ssl does by default.  PR 57070

Submitted by: rpluem
Reviewed by: jailletc36, ylavic, covener
Backported by: jailletc36

Modified:
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1650659&r1=1650658&r2=1650659&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Fri Jan  9 20:51:03 2015
@@ -22,8 +22,11 @@ Changes with Apache 2.4.11
      request headers earlier.  Adds "MergeTrailers" directive to restore
      legacy behavior.  [Edward Lu, Yann Ylavic, Joe Orton, Eric Covener]
 
+  *) mod_ssl: Do not crash when looking up SSL related variables during
+     expression evaluation on non SSL connections. PR 57070  [Ruediger Pluem]
+
   *) mod_proxy_ajp: Fix handling of the default port (8009) in the
-     ProxyPass and <Proxy> configurations.  PR 57259.  [Yann Ylavic].
+     ProxyPass and <Proxy> configurations.  PR 57259.  [Yann Ylavic]
 
   *) mpm_event: Avoid a possible use after free when notifying the end of
      connection during lingering close.  PR 57268.  [Eric Covener, Yann Ylavic]

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1650659&r1=1650658&r2=1650659&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Fri Jan  9 20:51:03 2015
@@ -104,14 +104,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_ssl: Check if we are having an SSL connection before looking up SSL
-              related variables during expression evaluation to avoid a crash.
-              If not return NULL as ssl_var_lookup_ssl does by default.  PR 57070
-     trunk patch: http://svn.apache.org/r1630947
-                  http://svn.apache.org/r1645670
-     2.4.x patch: trunk works (modulo CHANGES)
-     +1: jailletc36, ylavic, covener
-
    * mod_proxy_fcgi: Ignore body data from backend for 304 responses. PR 57198.
      trunk patch: http://svn.apache.org/r1640495
                   http://svn.apache.org/r1644031

Modified: httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c?rev=1650659&r1=1650658&r2=1650659&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c (original)
+++ httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c Fri Jan  9 20:51:03 2015
@@ -73,7 +73,9 @@ static apr_array_header_t *expr_peer_ext
 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) : NULL;
 }
 
 static int ssl_expr_lookup(ap_expr_lookup_parms *parms)