From: Nick Kew Date: Wed, 2 Apr 2008 23:08:22 +0000 (+0000) Subject: Expression evaluation: treat null expression as unconditional, not segfault. X-Git-Tag: 2.3.0~828 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f231b6f0aab63c7aae7a1522d3400cb1e46d089;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/server/util_expr.c b/server/util_expr.c index fd1fd994242..a9a6640e6aa 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,