From: Ruediger Pluem Date: Tue, 8 Jan 2008 16:38:14 +0000 (+0000) Subject: * Address two edge cases: X-Git-Tag: 2.3.0~1043 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=290cab6745bb2f66d33aa16a9c1b8cbf82cd30a0;p=apache * 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 --- 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. */