From: hno <> Date: Thu, 27 Dec 2007 07:48:06 +0000 (+0000) Subject: Memory corruption in IPAddress::ToURL, called when printing out IPAddress values X-Git-Tag: BASIC_TPROXY4~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=303bfd769de366fc8b609393e78503d494b4bd4f;p=thirdparty%2Fsquid.git Memory corruption in IPAddress::ToURL, called when printing out IPAddress values --- diff --git a/lib/IPAddress.cc b/lib/IPAddress.cc index 4ec5014d69..47e104c282 100644 --- a/lib/IPAddress.cc +++ b/lib/IPAddress.cc @@ -1,5 +1,5 @@ /* - * $Id: IPAddress.cc,v 1.2 2007/12/26 23:59:28 hno Exp $ + * $Id: IPAddress.cc,v 1.3 2007/12/27 00:48:06 hno Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -1060,7 +1060,7 @@ char* IPAddress::ToURL(char* buf, unsigned int blen) const } // force a null-terminated string - buf[blen] = '\0'; + buf[blen-1] = '\0'; return buf; }