From: Amos Jeffries Date: Mon, 24 May 2010 01:56:50 +0000 (+1200) Subject: Fix ToHostname potentially truncating port numbers X-Git-Tag: SQUID_3_2_0_1~200 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=188a640f3a3137b39c6cbb1f8cad2648fa754b1e;p=thirdparty%2Fsquid.git Fix ToHostname potentially truncating port numbers --- diff --git a/src/ip/Address.cc b/src/ip/Address.cc index 69e406e236..86a32f3196 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -1026,11 +1026,11 @@ Ip::Address::ToHostname(char *buf, const unsigned int blen) const p++; } - /* 7 being space for [,], and port */ + /* 8 being space for [ ] : and port digits */ if ( IsIPv6() ) - NtoA(p, blen-7, AF_INET6); + NtoA(p, blen-8, AF_INET6); else - NtoA(p, blen-7, AF_INET); + NtoA(p, blen-8, AF_INET); // find the end of the new string while (*p != '\0' && p < buf+blen)