]> granicus.if.org Git - apache/commitdiff
* Address two edge cases:
authorRuediger Pluem <rpluem@apache.org>
Tue, 8 Jan 2008 16:38:14 +0000 (16:38 +0000)
committerRuediger Pluem <rpluem@apache.org>
Tue, 8 Jan 2008 16:38:14 +0000 (16:38 +0000)
  1. The brigade contains only META buckets.
  2. The last data bucket is of zero length.

Pointed out by: niq

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@610061 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_filters.c

index 9ce581a849e4f22916c99ae76414be0088ee2277..dbc39fdab9312e93b6fbafc5985c5e4c7b533323 100644 (file)
@@ -139,11 +139,15 @@ static apr_status_t get_remaining_chunk_line(http_ctx_t *ctx,
             break;
         }
     }
+    /* We only had META buckets in this brigade */
+    if (e == APR_BRIGADE_SENTINEL(b)) {
+        return APR_EAGAIN;
+    }
     rv = apr_bucket_read(e, &lineend, &len, APR_BLOCK_READ);
     if (rv != APR_SUCCESS) {
         return rv;
     }
-    if (lineend[len - 1] != APR_ASCII_LF) {
+    if ((len == 0) || (lineend[len - 1] != APR_ASCII_LF)) {
         return APR_EAGAIN;
     }
     /* Line is complete. So reset ctx->linesize for next round. */