www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Good ...@about-inc.com>
Subject mod_rewrite/7272: patch for RewriteCond string test preventing apache startup
Date Mon, 19 Feb 2001 05:16:49 GMT

>Number:         7272
>Category:       mod_rewrite
>Synopsis:       patch for RewriteCond string test preventing apache startup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Sun Feb 18 21:20:00 PST 2001
>Originator:     dg@about-inc.com
>Release:        1.3.17
*** mod_rewrite.c.orig  Sun Feb 18 21:04:05 2001
--- mod_rewrite.c       Sun Feb 18 21:37:26 2001
*** 607,612 ****
--- 607,629 ----
+     /* CondPattern is not always a regular expression, such
+        as the ">string" case or the "=string" case.  It is
+        possible in these non-regex cases to have a sequence
+        of characters that represent an illegal regex, for
+        example "=**" (admittedly contrived :).  Let's return
+        here for the non-regex cases, since a failed regex
+        compile means apache will refuse to startup. */
+     switch (*cp) {
+         case '-':
+         case '>':
+         case '<':
+         case '=':
+             new->pattern = ap_pstrdup(cmd->pool, cp);
+             new->regexp  = NULL;
+             return NULL;
+     }
      /* now be careful: Under the POSIX regex library
         we can compile the pattern for case-insensitive matching,
         under the old V8 library we have to do it self via a hack */
RewriteCond %{QUERY_STRING} =**

3# apachectl start
Syntax error on line 217 of /usr/local/apache/conf/httpd.conf:
RewriteCond: cannot compile regular expression '=**'

/usr/local/bin/apachectl start: httpd could not be started
see description
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]

View raw message