]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r693727, r693728 from trunk:
authorJim Jagielski <jim@apache.org>
Wed, 17 Sep 2008 14:31:35 +0000 (14:31 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 17 Sep 2008 14:31:35 +0000 (14:31 +0000)
* Allow empty substitute patterns (to remove data from the stream), but
  disallow empty search patterns.

* Fix potential segfault if flags remains NULL.

Submitted by: rpluem
Reviewed by: jim

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

STATUS
modules/filters/mod_substitute.c

diff --git a/STATUS b/STATUS
index 331cfc947450469e8cc398b8b7a6c64fb7327fac..a2fbb5bad5425d4a6b496abecbff65e0f07b478f 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -92,27 +92,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
    http://svn.apache.org/viewvc?rev=639010&view=rev (mmn)
    +1: niq, rpluem, mturk
 
- * mod_proxy: Add the possibility to set a separate connection timeout for
-   backend workers.
-   PR: 45445
-    Trunk version of patch:
-       http://svn.apache.org/viewvc?rev=684341&view=rev
-    Backport version for 2.2.x of patch:
-       Trunk version of patch works, but 
-       http://people.apache.org/~rpluem/patches/37770_2.2.x.diff
-       fixes a conflict regarding the needed minor bump.
-    +1: rpluem, jim, jerenkrantz
-
- * mod_proxy_balancer: Allow for treatment of ';' char as a session
-   deliminator/separator, ala mod_jk.
-   PR: 45158
-    Trunk version of patch:
-       http://svn.apache.org/viewvc?rev=686809&view=rev
-       http://svn.apache.org/viewvc?rev=687754&view=rev
-    Backport version for 2.2.x of patch:
-       http://people.apache.org/~jim/patches/scolon-proxy.patch.txt
-    +1: jim, rpluem, jerenkrantz
-
  * mod_authn_alias: Propogate a NULL get_realm_hash() implementation 
    from AuthnProviderAlias back to mod_auth_digest. This moves detection
    of an incompatible-with-digest provider to a startup error.
@@ -123,15 +102,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
        http://people.apache.org/~covener/2.2.x-auth_alias_digest.diff 
    +1: covener, rpluem, jerenkrantz
 
- * mod_substitute: Allow empty substitute patterns (to remove data from the
-   stream), but disallow empty search patterns.
-   Trunk version of patches:
-      http://svn.apache.org/viewvc?rev=693727&view=rev
-      http://svn.apache.org/viewvc?rev=693728&view=rev
-   Backport version for 2.2.x of patch:
-       Trunk version of patches works
-   +1: rpluem, covener, jerenkrantz
-
  * mod_proxy_ajp: If CPING fails retry once more with a fresh TCP connection.
    If this fails as well give up.
    Trunk version of patches:
index ebe860d66bf55f392b180274158cc6abc4e1cf28..a50248f323de4f0b1676549872e67eb3128c971a 100644 (file)
@@ -507,37 +507,43 @@ static const char *set_pattern(cmd_parms *cmd, void *cfg, const char *line)
     if (delim)
         from = ++ourline;
     if (from) {
-        while (*++ourline && *ourline != delim);
+        if (*ourline != delim) {
+            while (*++ourline && *ourline != delim);
+        }
         if (*ourline) {
             *ourline = '\0';
             to = ++ourline;
         }
     }
     if (to) {
-        while (*++ourline && *ourline != delim);
+        if (*ourline != delim) {
+            while (*++ourline && *ourline != delim);
+        }
         if (*ourline) {
             *ourline = '\0';
             flags = ++ourline;
         }
     }
 
-    if (!delim || !from || !to) {
+    if (!delim || !from || !*from || !to) {
         return "Bad Substitute format, must be a complete s/// pattern";
     }
 
-    while (*flags) {
-        delim = apr_tolower(*flags);    /* re-use */
-        if (delim == 'i')
-            ignore_case = 1;
-        else if (delim == 'n')
-            is_pattern = 1;
-        else if (delim == 'f')
-            flatten = 1;
-        else if (delim == 'q')
-            flatten = 0;
-        else
-            return "Bad Substitute flag, only s///[infq] are supported";
-        flags++;
+    if (flags) {
+        while (*flags) {
+            delim = apr_tolower(*flags);    /* re-use */
+            if (delim == 'i')
+                ignore_case = 1;
+            else if (delim == 'n')
+                is_pattern = 1;
+            else if (delim == 'f')
+                flatten = 1;
+            else if (delim == 'q')
+                flatten = 0;
+            else
+                return "Bad Substitute flag, only s///[infq] are supported";
+            flags++;
+        }
     }
 
     /* first see if we can compile the regex */