diff --git a/buckets/apr_brigade.c b/buckets/apr_brigade.c index 5a94031635..90664b67f7 100644 --- a/buckets/apr_brigade.c +++ b/buckets/apr_brigade.c @@ -336,7 +336,8 @@ APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, apr_off_t maxbytes) { apr_off_t readbytes = 0; - apr_bucket *prev = NULL; + + APR_BRIGADE_CHECK_CONSISTENCY(bbIn); while (!APR_BRIGADE_EMPTY(bbIn)) { const char *pos; @@ -346,10 +347,6 @@ APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, apr_bucket *e; e = APR_BRIGADE_FIRST(bbIn); - if (e == prev) { /* PR#51062: prevent infinite loop on a corrupt brigade */ - return APR_EGENERAL; /* FIXME: this should definitely be a "can't happen"! */ - } - prev = e; rv = apr_bucket_read(e, &str, &len, block); if (rv != APR_SUCCESS) {