From: Stefan Fritsch Date: Wed, 17 Mar 2010 19:59:56 +0000 (+0000) Subject: Correctly handle the case where apr_brigade_partition() returns APR_INCOMPLETE X-Git-Tag: 2.3.6~331 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a1c80fe2db2b6a559dc803d0a5e8af1f2eaa6fd;p=thirdparty%2Fapache%2Fhttpd.git Correctly handle the case where apr_brigade_partition() returns APR_INCOMPLETE and b points to the sentinel of ctx->proc_bb and not the sentinel of bb. (Similar fix as r910326) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@924452 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_sed.c b/modules/filters/mod_sed.c index f9c69b7eb90..84d5b7c302f 100644 --- a/modules/filters/mod_sed.c +++ b/modules/filters/mod_sed.c @@ -478,11 +478,13 @@ static apr_status_t sed_request_filter(ap_filter_t *f, if (!APR_BRIGADE_EMPTY(ctx->bb)) { apr_bucket *b = NULL; - /* This may return APR_INCOMPLETE which should be fine */ - apr_brigade_partition(ctx->bb, readbytes, &b); - - APR_BRIGADE_CONCAT(bb, ctx->bb); - apr_brigade_split_ex(bb, b, ctx->bb); + if (apr_brigade_partition(ctx->bb, readbytes, &b) == APR_INCOMPLETE) { + APR_BRIGADE_CONCAT(bb, ctx->bb); + } + else { + APR_BRIGADE_CONCAT(bb, ctx->bb); + apr_brigade_split_ex(bb, b, ctx->bb); + } } return APR_SUCCESS; }