------------------------------------------------------------ revno: 9201 revision-id: squid3@treenet.co.nz-20140827144152-3zho6cb35nsjtsk7 parent: squid3@treenet.co.nz-20130710124816-rwu1kx4c287bq6gl committer: Amos Jeffries branch nick: SQUID_3_0 timestamp: Wed 2014-08-27 08:41:52 -0600 message: Ignore Range headers with unidentifiable byte-range values If squid is unable to determine the byte value for ranges, treat the header as invalid. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140827144152-3zho6cb35nsjtsk7 # target_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_0 # testament_sha1: 6878b512533ec44a3accc27adb9f2d06e3a03065 # timestamp: 2014-08-27 14:42:26 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_0 # base_revision_id: squid3@treenet.co.nz-20130710124816-\ # rwu1kx4c287bq6gl # # Begin patch === modified file 'src/HttpHdrRange.cc' --- src/HttpHdrRange.cc 2008-04-25 08:45:27 +0000 +++ src/HttpHdrRange.cc 2014-08-27 14:41:52 +0000 @@ -93,7 +93,7 @@ /* is it a suffix-byte-range-spec ? */ if (*field == '-') { - if (!httpHeaderParseOffset(field + 1, &length)) + if (!httpHeaderParseOffset(field + 1, &length) || !known_spec(length)) return false; } else /* must have a '-' somewhere in _this_ field */ @@ -101,7 +101,7 @@ debugs(64, 2, "ignoring invalid (missing '-') range-spec near: '" << field << "'"); return false; } else { - if (!httpHeaderParseOffset(field, &offset)) + if (!httpHeaderParseOffset(field, &offset) || !known_spec(offset)) return false; p++; @@ -110,7 +110,7 @@ if (p - field < flen) { int64_t last_pos; - if (!httpHeaderParseOffset(p, &last_pos)) + if (!httpHeaderParseOffset(p, &last_pos) || !known_spec(last_pos)) return false; HttpHdrRangeSpec::HttpRange aSpec (offset, last_pos + 1);