httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rede...@apache.org
Subject cvs commit: httpd-2.0/server protocol.c
Date Tue, 08 Jul 2003 21:21:13 GMT
rederpj     2003/07/08 14:21:13

  Modified:    .        CHANGES
               server   protocol.c
  Log:
  Update the header token parsing code to allow LWS between the token word
  and the ':' seperator.  [PR 16520]
  [submitted: Kris Verbeeck <kris.verbeeck@advalvas.be> and
              Nicel KM <mnicel@yahoo.com>]
  [Reviewed: <coad@measurement-factory.com> and
             Paul J. Reder]
  
  Revision  Changes    Path
  1.1212    +7 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1211
  retrieving revision 1.1212
  diff -u -r1.1211 -r1.1212
  --- CHANGES	7 Jul 2003 20:07:36 -0000	1.1211
  +++ CHANGES	8 Jul 2003 21:21:12 -0000	1.1212
  @@ -2,6 +2,13 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Update the header token parsing code to allow LWS between the
  +     token word and the ':' seperator.  [PR 16520]
  +     [submitted: Kris Verbeeck <kris.verbeeck@advalvas.be> and
  +                 Nicel KM <mnicel@yahoo.com>]
  +     [Reviewed: <coad@measurement-factory.com> and
  +                Paul J. Reder]
  +
     *) mod_ext_filter: Add the ability to filter request bodies.
        [Philipp Reisner <philipp.reisner@linbit.com>]
   
  
  
  
  1.133     +18 -1     httpd-2.0/server/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
  retrieving revision 1.132
  retrieving revision 1.133
  diff -u -r1.132 -r1.133
  --- protocol.c	22 Jun 2003 22:08:53 -0000	1.132
  +++ protocol.c	8 Jul 2003 21:21:13 -0000	1.133
  @@ -705,6 +705,7 @@
       char *value;
       apr_size_t len;
       int fields_read = 0;
  +    char *tmp_field;
   
       /*
        * Read header lines until we get the empty separator line, a read error,
  @@ -787,9 +788,25 @@
                   }
   
                   *value = '\0';
  -                ++value;
  +                tmp_field = value;  /*Used to trim the whitespace between key */
  +                ++value;            /*     token and seperator*/
                   while (*value == ' ' || *value == '\t') {
                       ++value;            /* Skip to start of value   */
  +                }
  +
  +                /* This check is to avoid any invalid memory reference while
  +                 *   traversing backwards in the key. To avoid a case where
  +                 *   the header starts with ':' (or with just some white
  +                 *   space and the ':') followed by the value
  +		         */
  +                if(tmp_field > last_field) {
  +                    --tmp_field;
  +                    while ((tmp_field > last_field) &&
  +                           (*tmp_field == ' ' || *tmp_field == '\t')) {
  +                        --tmp_field;   /* Removing LWS between key and ':' */
  +                    }
  +                    ++tmp_field;
  +                    *tmp_field = '\0';
                   }
   
                   apr_table_addn(r->headers_in, last_field, value);
  
  
  

Mime
View raw message