From 290cab6745bb2f66d33aa16a9c1b8cbf82cd30a0 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Tue, 8 Jan 2008 16:38:14 +0000 Subject: [PATCH] * Address two edge cases: 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index 9ce581a849..dbc39fdab9 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -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. */ -- 2.40.0