diff options
author | Nick Kew <niq@apache.org> | 2008-04-03 01:08:22 +0200 |
---|---|---|
committer | Nick Kew <niq@apache.org> | 2008-04-03 01:08:22 +0200 |
commit | 2f231b6f0aab63c7aae7a1522d3400cb1e46d089 (patch) | |
tree | d4d9c2b8fd791035b0b0fea1b40d108bd24d3a46 /server/util_expr.c | |
parent | * Prevent a segfault if the destination URI of a copy / move operation is (diff) | |
download | apache2-2f231b6f0aab63c7aae7a1522d3400cb1e46d089.tar.xz apache2-2f231b6f0aab63c7aae7a1522d3400cb1e46d089.zip |
Expression evaluation: treat null expression as unconditional, not segfault.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@644105 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/util_expr.c')
-rw-r--r-- | server/util_expr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/util_expr.c b/server/util_expr.c index fd1fd99424..a9a6640e6a 100644 --- a/server/util_expr.c +++ b/server/util_expr.c @@ -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, |