httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21095] - SSI error
Date Fri, 11 Jul 2003 03:07:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21095>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21095

SSI error





------- Additional Comments From jwoolley@apache.org  2003-07-11 03:07 -------
Andre: you read my mind about the bucket_next() thing.  I was just about to point that 
out.  :)  An alternative would be to do: 
         if (len == 0) { /* end of pipe? */ 
-            break; 
+            apr_bucket *next_dptr = APR_BUCKET_NEXT(dptr); 
+            apr_bucket_delete(dptr); 
+            dptr = next_dptr; 
+            continue; 
         } 
 
OH!  But hang on.  There's a bug in both cases: if (dptr) becomes the sentinel we 
must not continue; we have to break.  Otherwise we'll segfault the next time through 
the loop when we try to call apr_bucket_read() on the sentinel.  That is, no doubt, why 
it was break; before -- a pipe bucket was probably always the last bucket in the 
brigade when we hit that case during the testing.  The code was wrong, but it would 
have worked in that instance. 
 
Try this patch instead: 
 
Index: mod_include.c 
=================================================================== 
RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v 
retrieving revision 1.233 
diff -u -d -r1.233 mod_include.c 
--- mod_include.c       3 Feb 2003 17:53:01 -0000       1.233 
+++ mod_include.c       11 Jul 2003 03:03:25 -0000 
@@ -429,7 +429,13 @@ 
         } 
 
         if (len == 0) { /* end of pipe? */ 
-            break; 
+            apr_bucket *next_dptr = APR_BUCKET_NEXT(dptr); 
+            apr_bucket_delete(dptr); 
+            dptr = next_dptr; 
+            if (dptr == APR_BRIGADE_SENTINEL(bb)) { 
+                break; 
+            } 
+            continue; 
         } 
 
         /* Set our buffer to use. */ 
@@ -600,7 +606,13 @@ 
         } 
 
         if (len == 0) { /* end of pipe? */ 
-            break; 
+            apr_bucket *next_dptr = APR_BUCKET_NEXT(dptr); 
+            apr_bucket_delete(dptr); 
+            dptr = next_dptr; 
+            if (dptr == APR_BRIGADE_SENTINEL(bb)) { 
+                break; 
+            } 
+            continue; 
         } 
         if (dptr == ctx->tag_start_bucket) { 
             c = buf + ctx->tag_start_index;

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message