]> granicus.if.org Git - apache/commitdiff
Update r795445 patch in the light of rpluem's comments on-list
authorNick Kew <niq@apache.org>
Sun, 19 Jul 2009 21:54:36 +0000 (21:54 +0000)
committerNick Kew <niq@apache.org>
Sun, 19 Jul 2009 21:54:36 +0000 (21:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@795642 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_include.c

index 5d65d7abc36b281294681196c80ac1faae047a01..4d1b5d401d28d9b498cfc430f3a266ff21dc14e1 100644 (file)
@@ -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,