]> granicus.if.org Git - apache/commitdiff
fix for a segfault that occurred when mod_include was used to deliver files shorter...
authorBrian Pane <brianp@apache.org>
Thu, 22 Nov 2001 06:03:10 +0000 (06:03 +0000)
committerBrian Pane <brianp@apache.org>
Thu, 22 Nov 2001 06:03:10 +0000 (06:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92131 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_include.c

index e1f7112566a82a617987447c81ee15974cc9c578..3da84a98d5e8eace727b13a7005637d96d0e6646 100644 (file)
@@ -418,10 +418,15 @@ static apr_bucket *find_start_sequence(apr_bucket *dptr, include_ctx_t *ctx,
         }
         
         /* Consider the case where we have <!-- at the end of the bucket. */
-        ctx->bytes_parsed += len - slen;
+        if (len > slen) {
+            ctx->bytes_parsed += (len - slen);
+            c = buf + len - slen;
+        }
+        else {
+            c = buf;
+        }
         ctx->parse_pos = 0;
 
-        c = buf + len - slen + 1;
         while (c < buf + len)
         {
             if (*c == str[ctx->parse_pos]) {