From da9a38d4e9ded0901db1bd4b6144f0213ebecea7 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 3 Mar 2015 16:03:32 +0100 Subject: [PATCH] Handle no useful address types from getaddrinfo() --- common/network/TcpSocket.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx index 5158e805..ef7f55db 100644 --- a/common/network/TcpSocket.cxx +++ b/common/network/TcpSocket.cxx @@ -234,6 +234,9 @@ TcpSocket::TcpSocket(const char *host, int port) } freeaddrinfo(ai); + + if (current == NULL) + throw Exception("No useful address for host"); #endif /* HAVE_GETADDRINFO */ if (result == -1) -- 2.39.5