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 Mon, 24 Mar 2003 16:39:26 GMT
gregames    2003/03/24 08:39:26

  Modified:    .        CHANGES
               server   protocol.c
  Log:
  ap_get_mime_headers_core: allocate space for the trailing null when there
  are folded headers. PR 18170 [Peter Mayne <PeterMayne@SPAM_SUX.ap.spherion.com>]
  
  Revision  Changes    Path
  1.1129    +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1128
  retrieving revision 1.1129
  diff -u -r1.1128 -r1.1129
  --- CHANGES	22 Mar 2003 22:15:40 -0000	1.1128
  +++ CHANGES	24 Mar 2003 16:39:25 -0000	1.1129
  @@ -2,6 +2,10 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) ap_get_mime_headers_core: allocate space for the trailing null
  +     when folding is in effect.
  +     PR 18170 [Peter Mayne <PeterMayne@SPAM_SUX.ap.spherion.com>]
  +
     *) Do not bypass output filters when redirecting subrequests internally.
        PR 17629.  [André Malo]
   
  
  
  
  1.128     +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.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- protocol.c	3 Feb 2003 17:53:19 -0000	1.127
  +++ protocol.c	24 Mar 2003 16:39:25 -0000	1.128
  @@ -798,11 +798,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