/[Apache-SVN]/httpd/httpd/trunk/modules/filters/mod_include.c
ViewVC logotype

Diff of /httpd/httpd/trunk/modules/filters/mod_include.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 772997, Fri May 8 14:13:15 2009 UTC revision 795445, Sat Jul 18 23:12:58 2009 UTC
# Line 605  static const char *get_include_var(const Line 605  static const char *get_include_var(const
605           * The choice of returning NULL strings on not-found,           * The choice of returning NULL strings on not-found,
606           * v.s. empty strings on an empty match is deliberate.           * v.s. empty strings on an empty match is deliberate.
607           */           */
608          if (!re) {          if (!re || !re->have_match) {
609              ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,              ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
610                  "regex capture $%" APR_SIZE_T_FMT " refers to no regex in %s",                  "regex capture $%" APR_SIZE_T_FMT " refers to no regex in %s",
611                  idx, r->filename);                  idx, r->filename);
612              return NULL;              return NULL;
613          }          }
614          else {          else if (re->match[idx]rm_so == re->match[idx].rm_eo) {
615              if (re->nsub < idx || idx >= AP_MAX_REG_MATCH) {              return NULL;
616            }
617            else if (re->match[idx].rm_so < 0 || re->match[idx].rm_eo < 0) {
618                /* I don't think this can happen if have_match is true.
619                 * But let's not risk a regression by dropping this
620                 */
621                return NULL;
622            }
623            else if (re->nsub < idx || idx >= AP_MAX_REG_MATCH) {
624                  ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,                  ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
625                                "regex capture $%" APR_SIZE_T_FMT                                "regex capture $%" APR_SIZE_T_FMT
626                                " is out of range (last regex was: '%s') in %s",                                " is out of range (last regex was: '%s') in %s",
# Line 620  static const char *get_include_var(const Line 628  static const char *get_include_var(const
628                  return NULL;                  return NULL;
629              }              }
630    
631              if (re->match[idx].rm_so < 0 || re->match[idx].rm_eo < 0) {          else {
                 return NULL;  
             }  
   
632              val = apr_pstrmemdup(ctx->dpool, re->source + re->match[idx].rm_so,              val = apr_pstrmemdup(ctx->dpool, re->source + re->match[idx].rm_so,
633                                   re->match[idx].rm_eo - re->match[idx].rm_so);                                   re->match[idx].rm_eo - re->match[idx].rm_so);
634          }          }

Legend:
Removed from v.772997  
changed lines
  Added in v.795445

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2