httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Thu, 30 Aug 2001 11:42:59 GMT
trawick     01/08/30 04:42:59

  Modified:    server   core.c
  Log:
  fix an endless loop (well, until you run out of storage from
  tiny apr_pstrdup() calls and your machine crashes) when you
  have a filter chain
  
    ap_getword() returns an empty string, not a NULL string,
    when there are no more words
  
  fix a segfault when you don't have a filter chain
  
    ap_getword() does not check for a NULL string to search
  
  Revision  Changes    Path
  1.56      +8 -4      httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- core.c	2001/08/30 08:26:08	1.55
  +++ core.c	2001/08/30 11:42:59	1.56
  @@ -3358,13 +3358,17 @@
   						   &core_module); 
       const char *filter, *filters = conf->output_filters;
   
  -    while ((filter = ap_getword(r->pool, &filters, ';'))) {
  -        ap_add_output_filter(filter, NULL, r, r->connection);
  +    if (filters) {
  +        while ((filter = ap_getword(r->pool, &filters, ';')) && filter[0])
{
  +            ap_add_output_filter(filter, NULL, r, r->connection);
  +        }
       }
   
       filters = conf->input_filters;
  -    while ((filter = ap_getword(r->pool, &filters, ';'))) {
  -        ap_add_input_filter(filter, NULL, r, r->connection);
  +    if (filters) {
  +        while ((filter = ap_getword(r->pool, &filters, ';')) && filter[0])
{
  +            ap_add_input_filter(filter, NULL, r, r->connection);
  +        }
       }
   }
   
  
  
  

Mime
View raw message