diff -ur tigervnc-1.3.0.orig/common/network/TcpSocket.cxx tigervnc-1.3.0/common/network/TcpSocket.cxx --- tigervnc-1.3.0.orig/common/network/TcpSocket.cxx 2014-02-07 16:35:24.644388330 +0200 +++ tigervnc-1.3.0/common/network/TcpSocket.cxx 2014-02-07 16:39:50.608078320 +0200 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -450,7 +451,10 @@ } void TcpListener::getMyAddresses(std::list* result) { - const hostent* addrs = gethostbyname(0); + char hostname[HOST_NAME_MAX]; + if (gethostname(hostname, HOST_NAME_MAX) < 0) + throw rdr::SystemException("gethostname", errorNumber); + const hostent* addrs = gethostbyname(hostname); if (addrs == 0) throw rdr::SystemException("gethostbyname", errorNumber); if (addrs->h_addrtype != AF_INET)