]> granicus.if.org Git - apache/commitdiff
Expression evaluation: treat null expression as unconditional, not segfault.
authorNick Kew <niq@apache.org>
Wed, 2 Apr 2008 23:08:22 +0000 (23:08 +0000)
committerNick Kew <niq@apache.org>
Wed, 2 Apr 2008 23:08:22 +0000 (23:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@644105 13f79535-47bb-0310-9956-ffa450edef68

server/util_expr.c

index fd1fd99424282101541002b9257ed4f6d1dff13b..a9a6640e6aa91b02d0324eb2ce0fd0b0c3dcbe6a 100644 (file)
@@ -871,7 +871,11 @@ AP_DECLARE(int) ap_expr_eval(request_rec *r, ap_parse_node_t *root,
                              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,