From: Greg Ames Date: Sat, 27 Aug 2011 19:57:41 +0000 (+0000) Subject: merge totally reversed ranges like 4-5,1-2 into 1-5 X-Git-Tag: 2.3.15~333 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=acac1296dd80f909a7f521ac12edc7dd7cf29692;p=thirdparty%2Fapache%2Fhttpd.git merge totally reversed ranges like 4-5,1-2 into 1-5 I interpret the former test if (!(end <= ostart || start-1 >= oend)) { as if (not(end is bad || start is good)) { merge } ORing the bad condition with the good doesn't produce the desired result. it is not necessary to test "end" due to the conditions tested in the assert. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1162434 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/byterange_filter.c b/modules/http/byterange_filter.c index 69657061063..e132574d6b2 100644 --- a/modules/http/byterange_filter.c +++ b/modules/http/byterange_filter.c @@ -531,8 +531,10 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength, continue; } in_merge = 0; + + AP_DEBUG_ASSERT((start <= end) && (ostart <= oend)); - if (!(end <= ostart || start-1 >= oend)) { + if (start-1 < oend) { if (start < ostart) { ostart = start; reversals++;