If throwing when String exceeds its 64K limit is
acceptable then why not just use my previous t2 patch?
HttpHeader::addVia() calls strListAdd() similarly as the old
did: it throws if str->canGrowBy(itemSize) returns false.


Eduard.

On 16.03.2017 10:38, Amos Jeffries wrote:
On 14/03/2017 5:24 a.m., Alex Rousskov wrote:
On 03/13/2017 08:25 AM, Eduard Bagdasaryan wrote:
On 14.02.2017 04:22, Amos Jeffries wrote:
The problem is with proxy where the admin has configured large headers
to be allowed, and receives a Via just under the 6KB liit. Our append
pushing it over by even one byte would assert.
Yes, except s/6/64/ and no special configuration is probably needed:
reply_header_max_size is 64KB by default (and so is String::SizeMax_).


I am attaching a patch using SBuf instead of String for Via
accumulating, as you previously suggested. I am not
sure this is a much better solution since we have to do an
extra copy into SBuf.
Will this new patch assert in String::setBuffer(?) when the final Via
value exceeds String::SizeMax_ and putStr() is called with a 64KB+1 or
longer value string?
Yes I think it still misses the size check there.

Any objections to applying this with this added:

   // XXX: putStr() still has String 64KB limits
   Must(strVia.length() < 64*1024);

Amos

_______________________________________________
squid-dev mailing list
[email protected]
http://lists.squid-cache.org/listinfo/squid-dev

_______________________________________________
squid-dev mailing list
[email protected]
http://lists.squid-cache.org/listinfo/squid-dev

Reply via email to