From 2f231b6f0aab63c7aae7a1522d3400cb1e46d089 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Wed, 2 Apr 2008 23:08:22 +0000 Subject: 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 --- server/util_expr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3