]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix ToHostname potentially truncating port numbers
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 24 May 2010 01:56:50 +0000 (13:56 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 24 May 2010 01:56:50 +0000 (13:56 +1200)
src/ip/Address.cc

index 69e406e23670e2fd04202bdee8b7e5d6d0e21087..86a32f3196d7f5b7e9cf6b8f821c37117e74ae28 100644 (file)
@@ -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)