httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_protocol.c
Date Fri, 13 Oct 2000 17:54:28 GMT
trawick     00/10/13 10:54:26

  Modified:    src/main http_protocol.c
  Log:
  getline() fixes...
  
  If ap_get_brigade() returns APR_SUCCESS but an empty brigade, bail out.
  Previously, we kept going and sometimes segfaulted while operating on
  what we thought was the first bucket.
  
  Free the temporary brigade used by getline().
  
  Revision  Changes    Path
  1.168     +5 -1      apache-2.0/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
  retrieving revision 1.167
  retrieving revision 1.168
  diff -u -r1.167 -r1.168
  --- http_protocol.c	2000/10/13 05:35:56	1.167
  +++ http_protocol.c	2000/10/13 17:54:24	1.168
  @@ -960,7 +960,9 @@
   
       while (1) {
           if (AP_BRIGADE_EMPTY(b)) {
  -            if (ap_get_brigade(c->input_filters, b, AP_GET_LINE) != APR_SUCCESS) {
  +            if (ap_get_brigade(c->input_filters, b, AP_GET_LINE) != APR_SUCCESS ||
  +                AP_BRIGADE_EMPTY(b)) {
  +                ap_brigade_destroy(b);
                   return -1;
               }
           }
  @@ -986,6 +988,7 @@
               /* input line was larger than the caller's buffer */
               AP_BUCKET_REMOVE(e);
               ap_bucket_destroy(e);
  +            ap_brigade_destroy(b);
               return -1;
           }
           
  @@ -1033,6 +1036,7 @@
               pos++;              /* bump past end of incomplete line      */
           }
       }
  +    ap_brigade_destroy(b);
       return total;
   }
   
  
  
  

Mime
View raw message