httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject cvs commit: httpd-2.0/server protocol.c
Date Fri, 18 Apr 2003 20:30:42 GMT
gregames    2003/04/18 13:30:42

  Modified:    .        Tag: APACHE_2_0_BRANCH STATUS
               server   Tag: APACHE_2_0_BRANCH protocol.c
  Log:
  ap_get_mime_headers_core: alloc space for trailing null when folding
  (backport fix for PR18170)
  
  Submitted by: Peter Mayne <PeterMayne@SPAM_SUX.ap.spherion.com>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.751.2.226 +1 -6      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.225
  retrieving revision 1.751.2.226
  diff -u -r1.751.2.225 -r1.751.2.226
  --- STATUS	17 Apr 2003 21:08:58 -0000	1.751.2.225
  +++ STATUS	18 Apr 2003 20:30:41 -0000	1.751.2.226
  @@ -221,11 +221,6 @@
         corresponding to mpm_common.xml if that isn't something you're
         comfortable with doing)
   
  -    * ap_get_mime_headers_core: alloc space for null terminator
  -      while folding
  -      server/protocol.c r1.128
  -      +1: gregames, jerenkrantz, trawick
  -
   CURRENT RELEASE NOTES:
   
       * Backwards compatibility is expected of future Apache 2.0 releases,
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.121.2.5 +4 -3      httpd-2.0/server/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
  retrieving revision 1.121.2.4
  retrieving revision 1.121.2.5
  diff -u -r1.121.2.4 -r1.121.2.5
  --- protocol.c	29 Mar 2003 16:33:29 -0000	1.121.2.4
  +++ protocol.c	18 Apr 2003 20:30:42 -0000	1.121.2.5
  @@ -753,11 +753,12 @@
                    * doing O(n) allocs and using O(n^2) space for
                    * continuations that span many many lines.
                    */
  -                if (last_len + len > alloc_len) {
  +                apr_size_t fold_len = last_len + len + 1; /* trailing null */
  +                if (fold_len > alloc_len) {
                       char *fold_buf;
                       alloc_len += alloc_len;
  -                    if (last_len + len > alloc_len) {
  -                        alloc_len = last_len + len;
  +                    if (fold_len > alloc_len) {
  +                        alloc_len = fold_len;
                       }
                       fold_buf = (char *)apr_palloc(r->pool, alloc_len);
                       memcpy(fold_buf, last_field, last_len);
  
  
  

Mime
View raw message