]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_setenvif: Fix the regex optimizer, which under circumstances
authorPaul J. Reder <rederpj@apache.org>
Thu, 5 Feb 2004 18:41:59 +0000 (18:41 +0000)
committerPaul J. Reder <rederpj@apache.org>
Thu, 5 Feb 2004 18:41:59 +0000 (18:41 +0000)
   treated the supplied regex as literal string. PR 24219.

Submitted by: Andr�� Malo
Reviewed by: jerenkrantz, trawick, rederpj

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@102516 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/metadata/mod_setenvif.c

diff --git a/CHANGES b/CHANGES
index 4752f548b2c64f72df36ac92a0174f56715736da..056721ee2aed67e2840d6bda217610b9da0ec359 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.49
 
+  *) mod_setenvif: Fix the regex optimizer, which under circumstances
+     treated the supplied regex as literal string. PR 24219.
+     [André Malo]
+
   *) ap_mpm.h: Fix include guard of ap_mpm.h to reference mpm
      instead of mmn. [André Malo]
 
diff --git a/STATUS b/STATUS
index 0386bb49ba04e253ef1ba5efa624f12e573e3f0f..cdd4e6b76aa114d222706ab1fcf06317806b003f 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/02/05 15:55:39 $]
+Last modified at [$Date: 2004/02/05 18:41:58 $]
 
 Release:
 
@@ -230,11 +230,6 @@ PATCHES TO BACKPORT FROM 2.1
          nd replies: But if it can't be 0 the alternatives thereafter make no
            sense anymore, right?
 
-    * mod_setenvif: Fix optimizer to treat regexps as such even if they
-      only contain anchors like \b. PR 24219.
-        modules/metadata/mod_setenvif.c: r1.44, r1.46
-      +1: nd, jerenkrantz, trawick
-
     * LDAP cache fixes from Matthieu Estrade; see PR 18756
         include/util_ldap.h r1.12
         modules/experimental/util_ldap.c r1.15, r1.16
index 30435eccb22cbc08fd3c5561ca9bdabd1c77bb37..259f9b6adf4d163260d40aee1e8e6faedfba0fdb 100644 (file)
@@ -239,29 +239,39 @@ static const char *non_regex_pattern(apr_pool_t *p, const char *s)
     int in_escape = 0;
 
     while (*src) {
-        if (in_escape) {
-            in_escape = 0;
-        }
-        else {
-            switch (*src) {
-            case '^':
-            case '.':
-            case '$':
-            case '|':
-            case '(':
-            case ')':
-            case '[':
-            case ']':
-            case '*':
-            case '+':
-            case '?':
-            case '{':
-            case '}':
+        switch (*src) {
+        case '^':
+        case '.':
+        case '$':
+        case '|':
+        case '(':
+        case ')':
+        case '[':
+        case ']':
+        case '*':
+        case '+':
+        case '?':
+        case '{':
+        case '}':
+            if (!in_escape) {
                 return NULL;
-            case '\\':
+            }
+            in_escape = 0;
+            break;
+        case '\\':
+            if (!in_escape) {
                 in_escape = 1;
                 escapes_found = 1;
             }
+            else {
+                in_escape = 0;
+            }
+            break;
+        default:
+            if (in_escape) {
+                return NULL;
+            }
+            break;
         }
         src++;
     }