tigervnc/tigervnc-sf3495623.patch
Michal Srb 88628913fb - Drop tigervnc-sf3492503.diff, tigervnc-sf3495623.diff and
tigervnc-sf3495623.patch.old (not used and not needed).
- Update tigervnc-sf3492352.diff and tigervnc-sf3495623.patch.

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/tigervnc?expand=0&rev=14
2014-02-07 15:01:00 +00:00

24 lines
903 B
Diff

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 <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
+#include <limits.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
@@ -450,7 +451,10 @@
}
void TcpListener::getMyAddresses(std::list<char*>* 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)