You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ni...@apache.org on 2008/04/03 01:08:23 UTC

svn commit: r644105 - /httpd/httpd/trunk/server/util_expr.c

Author: niq
Date: Wed Apr  2 16:08:22 2008
New Revision: 644105

URL: http://svn.apache.org/viewvc?rev=644105&view=rev
Log:
Expression evaluation: treat null expression as unconditional, not segfault.

Modified:
    httpd/httpd/trunk/server/util_expr.c

Modified: httpd/httpd/trunk/server/util_expr.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_expr.c?rev=644105&r1=644104&r2=644105&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_expr.c (original)
+++ httpd/httpd/trunk/server/util_expr.c Wed Apr  2 16:08:22 2008
@@ -871,7 +871,11 @@
                              int *was_error, backref_t **reptr,
                              string_func_t string_func, opt_func_t eval_func)
 {
-    ap_parse_node_t *clone = ap_expr_clone_tree(r->pool, root, NULL);
+    ap_parse_node_t *clone;
+    if (root == NULL) {  /* no condition == unconditional */
+        return 1;
+    }
+    clone = ap_expr_clone_tree(r->pool, root, NULL);
     return expr_eval(r, clone, was_error, reptr, string_func, eval_func);
 }
 AP_DECLARE(int) ap_expr_evalstring(request_rec *r, const char *expr,