@@ -101,8 +101,8 @@ void NetworkAddress::GetAddressAsString(
*/
std::string NetworkAddress::GetAddressAsString(bool with_family)
{
/* 6 = for the : and 5 for the decimal port number */
char buf[NETWORK_HOSTNAME_LENGTH + 6 + 7];
/* 7 extra are for with_family, which adds " (IPvX)". */
char buf[NETWORK_HOSTNAME_PORT_LENGTH + 7];
this->GetAddressAsString(buf, lastof(buf), with_family);
return buf;
}