Skip to content

Commit 1efa47e

Browse files
committed
* buckets/apr_brigade.c (apr_brigade_split_line): Replace ad-hoc
brigade memory corruption test with APR_BRIGADE_CHECK_CONSISTENCY. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1914764 13f79535-47bb-0310-9956-ffa450edef68
1 parent bde06d6 commit 1efa47e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

buckets/apr_brigade.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut,
336336
apr_off_t maxbytes)
337337
{
338338
apr_off_t readbytes = 0;
339-
apr_bucket *prev = NULL;
339+
340+
APR_BRIGADE_CHECK_CONSISTENCY(bbIn);
340341

341342
while (!APR_BRIGADE_EMPTY(bbIn)) {
342343
const char *pos;
@@ -346,10 +347,6 @@ APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut,
346347
apr_bucket *e;
347348

348349
e = APR_BRIGADE_FIRST(bbIn);
349-
if (e == prev) { /* PR#51062: prevent infinite loop on a corrupt brigade */
350-
return APR_EGENERAL; /* FIXME: this should definitely be a "can't happen"! */
351-
}
352-
prev = e;
353350
rv = apr_bucket_read(e, &str, &len, block);
354351

355352
if (rv != APR_SUCCESS) {

0 commit comments

Comments
 (0)