httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_include.c
Date Sat, 15 Dec 2001 03:22:24 GMT
brianp      01/12/14 19:22:24

  Modified:    modules/filters mod_include.c
  Log:
  Fix for segfault that happened upon reaching EOS in an
  intermediate SSI parsing state
  Submitted by:	Justin Erenkrantz
  
  Revision  Changes    Path
  1.167     +13 -1     httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.166
  retrieving revision 1.167
  diff -u -r1.166 -r1.167
  --- mod_include.c	2001/12/08 03:14:50	1.166
  +++ mod_include.c	2001/12/15 03:22:24	1.167
  @@ -2700,7 +2700,7 @@
                     ap_escape_shell_cmd(r->pool, arg_copy));
       }
   
  -    while (dptr != APR_BRIGADE_SENTINEL(*bb)) {
  +    while (dptr != APR_BRIGADE_SENTINEL(*bb) || !APR_BUCKET_IS_EOS(dptr)) {
           /* State to check for the STARTING_SEQUENCE. */
           if ((ctx->state == PRE_HEAD) || (ctx->state == PARSE_HEAD)) {
               int do_cleanup = 0;
  @@ -2941,6 +2941,18 @@
   
               ctx->state     = PRE_HEAD;
           }
  +    }
  +
  +    /* We have nothing more to send, stop now. */
  +    if (APR_BUCKET_IS_EOS(dptr)) {
  +        /* We might have something saved that we never completed, but send
  +         * down unparsed.  This allows for <!-- at the end of files to be
  +         * sent correctly. */
  +        if (!APR_BRIGADE_EMPTY(ctx->ssi_tag_brigade)) {
  +            APR_BRIGADE_CONCAT(ctx->ssi_tag_brigade, *bb);
  +            return ap_pass_brigade(f->next, ctx->ssi_tag_brigade);
  +        }
  +        return ap_pass_brigade(f->next, *bb);
       }
   
       /* If I am in the middle of parsing an SSI tag then I need to set aside
  
  
  

Mime
View raw message