From: Alex Rousskov Date: Mon, 13 May 2013 14:07:55 +0000 (-0600) Subject: Fixed leaking configurable SSL error details. X-Git-Tag: SQUID_3_4_0_1~151 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0de73a382e44901d386d8e35d076cfe747945495;p=thirdparty%2Fsquid.git Fixed leaking configurable SSL error details. Trunk r11496 "Configurable SSL error details messages" correctly disabled collection of HTTP statistics for non-HTTP header fields, such as configurable SSL error details. However, it also incorrectly disabled deletion of those non-HTTP header fields. Configurable SSL error details are only created during [re]configuration time, so the leak went unnoticed since 2011-06-17, but the same bug caused a major runtime annotation leak later (r12413) until the new annotation code was redesigned to avoid using HttpHeader (r12779). --- diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 5dce4eed1d..54c737bdf2 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -441,6 +441,7 @@ HttpHeader::clean() PROF_start(HttpHeaderClean); + if (owner <= hoReply) { /* * An unfortunate bug. The entries array is initialized * such that count is set to zero. httpHeaderClean() seems to @@ -451,14 +452,13 @@ HttpHeader::clean() * has been used. As a hack, just never count zero-sized header * arrays. */ - - if (owner <= hoReply) { if (0 != entries.count) HttpHeaderStats[owner].hdrUCountDistr.count(entries.count); ++ HttpHeaderStats[owner].destroyedCount; HttpHeaderStats[owner].busyDestroyedCount += entries.count > 0; + } // if (owner <= hoReply) while ((e = getEntry(&pos))) { /* tmp hack to try to avoid coredumps */ @@ -466,12 +466,12 @@ HttpHeader::clean() if (e->id < 0 || e->id >= HDR_ENUM_END) { debugs(55, DBG_CRITICAL, "HttpHeader::clean BUG: entry[" << pos << "] is invalid (" << e->id << "). Ignored."); } else { + if (owner <= hoReply) HttpHeaderStats[owner].fieldTypeDistr.count(e->id); /* yes, this deletion leaves us in an inconsistent state */ delete e; } } - } // if (owner <= hoReply) entries.clean(); httpHeaderMaskInit(&mask, 0); len = 0;