diff -u squid3-3.0.STABLE19/debian/control squid3-3.0.STABLE19/debian/control --- squid3-3.0.STABLE19/debian/control +++ squid3-3.0.STABLE19/debian/control @@ -1,7 +1,8 @@ Source: squid3 Section: web Priority: optional -Maintainer: Luigi Gangitano +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Luigi Gangitano Homepage: http://www.squid-cache.org Standards-Version: 3.8.3 Build-Depends: libldap2-dev, libpam0g-dev, libdb-dev, sharutils, dpatch (>= 2.0.9), cdbs, libsasl2-dev, debhelper (>=5), libcppunit-dev, libkrb5-dev, comerr-dev diff -u squid3-3.0.STABLE19/debian/changelog squid3-3.0.STABLE19/debian/changelog --- squid3-3.0.STABLE19/debian/changelog +++ squid3-3.0.STABLE19/debian/changelog @@ -1,3 +1,12 @@ +squid3 (3.0.STABLE19-1ubuntu0.1) lucid; urgency=low + + * SECURITY UPDATE: Fix DoS due to wrong string handling. (LP: #718127) + - debian/patches/CVE-2010-3072.dpatch + - CVE-2010-3072 + - http://www.squid-cache.org/Advisories/SQUID-2010_3.txt + + -- Mahyuddin Susanto Thu, 17 Feb 2011 00:06:24 +0700 + squid3 (3.0.STABLE19-1) unstable; urgency=low * New upstream release diff -u squid3-3.0.STABLE19/debian/patches/00list squid3-3.0.STABLE19/debian/patches/00list --- squid3-3.0.STABLE19/debian/patches/00list +++ squid3-3.0.STABLE19/debian/patches/00list @@ -2,0 +3 @@ +CVE-2010-3072.dpatch only in patch2: unchanged: --- squid3-3.0.STABLE19.orig/debian/patches/CVE-2010-3072.dpatch +++ squid3-3.0.STABLE19/debian/patches/CVE-2010-3072.dpatch @@ -0,0 +1,127 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## Description: Fix DoS due to wrong string handling. +## Origin: http://bazaar.launchpad.net/~squid/squid/3.0/revision/9189 +## Bug: http://www.squid-cache.org/Advisories/SQUID-2010_3.txt +## Bug-Ubuntu: https://launchpad.net/bugs/718127 +## Bug-Debian: http://bugs.debian.org/596086 + +@DPATCH@ +diff -urNad squid3-3.0.STABLE19~/src/SquidString.h squid3-3.0.STABLE19/src/SquidString.h +--- squid3-3.0.STABLE19~/src/SquidString.h 2009-09-06 18:29:36.000000000 +0700 ++++ squid3-3.0.STABLE19/src/SquidString.h 2011-02-16 23:32:35.271047591 +0700 +@@ -127,6 +127,8 @@ + #endif + + private: ++ _SQUID_INLINE_ bool nilCmp(bool, bool, int &) const; ++ + /* never reference these directly! */ + unsigned short int size_; /* buffer size; 64K limit */ + +diff -urNad squid3-3.0.STABLE19~/src/String.cci squid3-3.0.STABLE19/src/String.cci +--- squid3-3.0.STABLE19~/src/String.cci 2009-09-06 18:29:36.000000000 +0700 ++++ squid3-3.0.STABLE19/src/String.cci 2011-02-16 23:37:40.955047092 +0700 +@@ -73,19 +73,30 @@ + return strrchr(buf(), (ch)); + } + +-int +-String::cmp (char const *aString) const ++/// compare NULL and empty strings because str*cmp() may fail on NULL strings ++/// and because we need to return consistent results for strncmp(count == 0). ++bool ++String::nilCmp(const bool thisIsNilOrEmpty, const bool otherIsNilOrEmpty, int &result) const + { +- /* strcmp fails on NULLS */ ++ if (!thisIsNilOrEmpty && !otherIsNilOrEmpty) ++ return false; // result does not matter + +- if (size() == 0 && (aString == NULL || aString[0] == '\0')) +- return 0; ++ if (thisIsNilOrEmpty && otherIsNilOrEmpty) ++ result = 0; ++ else if (thisIsNilOrEmpty) ++ result = -1; ++ else // otherIsNilOrEmpty ++ result = +1; + +- if (size() == 0) +- return -1; ++ return true; ++} + +- if (aString == NULL || aString[0] == '\0') +- return 1; ++int ++String::cmp (char const *aString) const ++{ ++ int result = 0; ++ if (nilCmp(!size(), (!aString || !*aString), result)) ++ return result; + + return strcmp(buf(), aString); + } +@@ -93,19 +104,9 @@ + int + String::cmp (char const *aString, size_t count) const + { +- /* always the same at length 0 */ +- +- if (count == 0) +- return 0; +- +- if (size() == 0 && (aString == NULL || aString[0] == '\0')) +- return 0; +- +- if (size() == 0) +- return -1; +- +- if (aString == NULL || aString[0] == '\0') +- return 1; ++ int result = 0; ++ if (nilCmp((!size() || !count), (!aString || !*aString || !count), result)) ++ return result; + + return strncmp(buf(), aString, count); + } +@@ -113,16 +114,9 @@ + int + String::cmp (String const &aString) const + { +- /* strcmp fails on NULLS */ +- +- if (size() == 0 && aString.size() == 0) +- return 0; +- +- if (size() == 0) +- return -1; +- +- if (aString.size() == 0) +- return 1; ++ int result = 0; ++ if (nilCmp(!size(), !aString.size(), result)) ++ return result; + + return strcmp(buf(), aString.buf()); + } +@@ -130,12 +124,20 @@ + int + String::caseCmp(char const *aString) const + { ++ int result = 0; ++ if (nilCmp(!size(), (!aString || !*aString), result)) ++ return result; ++ + return strcasecmp(buf(), aString); + } + + int + String::caseCmp(char const *aString, size_t count) const + { ++ int result = 0; ++ if (nilCmp((!size() || !count), (!aString || !*aString || !count), result)) ++ return result; ++ + return strncasecmp(buf(), aString, count); + } +