summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorNick Kew <niq@apache.org>2009-07-19 01:12:58 +0200
committerNick Kew <niq@apache.org>2009-07-19 01:12:58 +0200
commit9cd5afd69253006fa6c8919b3e9e813cf78691ec (patch)
tree856a7e36fbe098a8311f0dc8cc2f50db58fc3a39 /server
parentremoved useless comments added with r795438. (diff)
downloadapache2-9cd5afd69253006fa6c8919b3e9e813cf78691ec.tar.xz
apache2-9cd5afd69253006fa6c8919b3e9e813cf78691ec.zip
Fix mod_include potential segfault checking backref from unmatched regexp
http://markmail.org/message/jlc7t5edsjujbe37 Patch by rpluem, lars, niq git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@795445 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/util_expr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/util_expr.c b/server/util_expr.c
index 23c5750eaa..2a363ccd3a 100644
--- a/server/util_expr.c
+++ b/server/util_expr.c
@@ -265,7 +265,6 @@ static APR_INLINE int re_check(request_rec *r, const char *string,
{
ap_regex_t *compiled;
backref_t *re = reptr ? *reptr : NULL;
- int rc;
compiled = ap_pregcomp(r->pool, rexp, AP_REG_EXTENDED);
if (!compiled) {
@@ -284,10 +283,11 @@ static APR_INLINE int re_check(request_rec *r, const char *string,
re->source = apr_pstrdup(r->pool, string);
re->rexp = apr_pstrdup(r->pool, rexp);
re->nsub = compiled->re_nsub;
- rc = !ap_regexec(compiled, string, AP_MAX_REG_MATCH, re->match, 0);
+ re->have_match = !ap_regexec(compiled, string, AP_MAX_REG_MATCH,
+ re->match, 0);
ap_pregfree(r->pool, compiled);
- return rc;
+ return re->have_match;
}
static int get_ptoken(apr_pool_t *pool, const char **parse, token_t *token,