You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2008/09/10 10:00:59 UTC

svn commit: r693727 - /httpd/httpd/trunk/modules/filters/mod_substitute.c

Author: rpluem
Date: Wed Sep 10 01:00:58 2008
New Revision: 693727

URL: http://svn.apache.org/viewvc?rev=693727&view=rev
Log:
* Allow empty substitute patterns (to remove data from the stream), but
  disallow empty search patterns.

Modified:
    httpd/httpd/trunk/modules/filters/mod_substitute.c

Modified: httpd/httpd/trunk/modules/filters/mod_substitute.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_substitute.c?rev=693727&r1=693726&r2=693727&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_substitute.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_substitute.c Wed Sep 10 01:00:58 2008
@@ -507,21 +507,25 @@
     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";
     }