From 5a1c80fe2db2b6a559dc803d0a5e8af1f2eaa6fd Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 17 Mar 2010 19:59:56 +0000 Subject: [PATCH] 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 --- modules/filters/mod_sed.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/filters/mod_sed.c b/modules/filters/mod_sed.c index f9c69b7eb9..84d5b7c302 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; } -- 2.50.1