From: Amos Jeffries Date: Mon, 6 Jul 2009 01:51:39 +0000 (+1200) Subject: Author: Alex Rousskov X-Git-Tag: SQUID_3_0_STABLE17~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=441912c82ae6910b58c402d94aafee915c6aa971;p=thirdparty%2Fsquid.git Author: Alex Rousskov Bug 2659: String length overflows on append, leading to segfaults Long-term patch for 3.0. This softens the error, but does not resolve the issue completely for ESI. Short-term patch for 3.1. The limit is arbitrary and may be fixed at some point by a better patch. This one will work however. --- diff --git a/src/String.cc b/src/String.cc index 5fa2e5c3a5..d1edf6164c 100644 --- a/src/String.cc +++ b/src/String.cc @@ -173,6 +173,7 @@ String::append(const char *str, int len) len_ += len; } else { String snew; + assert(len_ + len < 65536); // otherwise snew.len_ overflows below snew.len_ = len_ + len; snew.initBuf(snew.len_ + 1);