httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1634948 - in /httpd/httpd/branches/2.4.x: STATUS modules/filters/mod_substitute.c
Date Tue, 28 Oct 2014 19:00:50 GMT
Author: rjung
Date: Tue Oct 28 19:00:50 2014
New Revision: 1634948

URL: http://svn.apache.org/r1634948
Log:
Merge r1631983 from trunk:

mod_substitute: no real functional change, but:
  - define default for maximum line length
    indepenent of MAX_STRING_LEN
  - Clarify line length check with a comment
  - add supported 'b' suffix to directive
    description

Submitted by: rjung
Reviewed by: jim, ylavic

Modified:
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/modules/filters/mod_substitute.c

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1634948&r1=1634947&r2=1634948&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Tue Oct 28 19:00:50 2014
@@ -110,16 +110,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: trunk patch works
      +1: jailletc36, rjung, ylavic
 
-   * mod_substitute: no real functional change, but:
-     - define default for maximum line length
-       indepenent of MAX_STRING_LEN
-     - Clarify line length check with a comment
-     - add supported 'b' suffix to directive
-       description
-     trunk patches: https://svn.apache.org/r1631983
-     2.4.x patch: trunk works, no CHANGES
-     +1: rjung, jim, ylavic
-
    * style fix
      trunk patch: http://svn.apache.org/r1633031
                   http://svn.apache.org/r1633522

Modified: httpd/httpd/branches/2.4.x/modules/filters/mod_substitute.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/filters/mod_substitute.c?rev=1634948&r1=1634947&r2=1634948&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/filters/mod_substitute.c (original)
+++ httpd/httpd/branches/2.4.x/modules/filters/mod_substitute.c Tue Oct 28 19:00:50 2014
@@ -38,7 +38,7 @@
  * Therefore we limit the resulting length of the line.
  * This is the default value.
  */
-#define AP_SUBST_MAX_LINE_LENGTH (128*MAX_STRING_LEN)
+#define AP_SUBST_MAX_LINE_LENGTH (1024*1024)
 
 static const char substitute_filter_name[] = "SUBSTITUTE";
 
@@ -243,9 +243,13 @@ static apr_status_t do_pattmatch(ap_filt
                         apr_status_t rv;
                         have_match = 1;
                         if (script->flatten && !force_quick) {
-                            /* copy bytes before the match */
+                            /* check remaining buffer size */
+                            /* Note that the last param in ap_varbuf_regsub below
+                             * must stay positive. If it gets 0, it would mean
+                             * unlimited space available. */
                             if (vb.strlen + regm[0].rm_so >= cfg->max_line_length)
                                 return APR_ENOMEM;
+                            /* copy bytes before the match */
                             if (regm[0].rm_so > 0)
                                 ap_varbuf_strmemcat(&vb, pos, regm[0].rm_so);
                             /* add replacement string, last argument is unsigned! */
@@ -672,7 +676,7 @@ static const char *set_max_line_length(c
     if (rv != APR_SUCCESS || max < 0)
     {
         return "SubstituteMaxLineLength must be a non-negative integer optionally "
-               "suffixed with 'k', 'm' or 'g'.";
+               "suffixed with 'b', 'k', 'm' or 'g'.";
     }
     dcfg->max_line_length = (apr_size_t)max;
     dcfg->max_line_length_set = 1;



Mime
View raw message