From: Nick Kew Date: Sun, 19 Jul 2009 21:54:36 +0000 (+0000) Subject: Update r795445 patch in the light of rpluem's comments on-list X-Git-Tag: 2.3.3~423 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9da0a13a7de9eb329a0edb3f411bde8cafdb36c;p=apache Update r795445 patch in the light of rpluem's comments on-list git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@795642 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 5d65d7abc3..4d1b5d401d 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -611,7 +611,11 @@ static const char *get_include_var(const char *var, include_ctx_t *ctx) idx, r->filename); return NULL; } - else if (re->match[idx].rm_so == re->match[idx].rm_eo) { + else if (re->nsub < idx || idx >= AP_MAX_REG_MATCH) { + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, + "regex capture $%" APR_SIZE_T_FMT + " is out of range (last regex was: '%s') in %s", + idx, re->rexp, r->filename); return NULL; } else if (re->match[idx].rm_so < 0 || re->match[idx].rm_eo < 0) { @@ -620,13 +624,6 @@ static const char *get_include_var(const char *var, include_ctx_t *ctx) */ return NULL; } - else if (re->nsub < idx || idx >= AP_MAX_REG_MATCH) { - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, - "regex capture $%" APR_SIZE_T_FMT - " is out of range (last regex was: '%s') in %s", - idx, re->rexp, r->filename); - return NULL; - } else { val = apr_pstrmemdup(ctx->dpool, re->source + re->match[idx].rm_so,