From 5991c2591949b8f658cd31b43601829ecfd39884 Mon Sep 17 00:00:00 2001 From: Chris Guillott Date: Sat, 9 Sep 2017 23:48:29 -0400 Subject: [PATCH] trap getaddrinfo return codes --- src/openrct2/network/TcpSocket.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/openrct2/network/TcpSocket.cpp b/src/openrct2/network/TcpSocket.cpp index c33b560918..d34abc34d0 100644 --- a/src/openrct2/network/TcpSocket.cpp +++ b/src/openrct2/network/TcpSocket.cpp @@ -451,6 +451,13 @@ private: addrinfo * result = nullptr; getaddrinfo(address, serviceName.c_str(), &hints, &result); + int errorcode = getaddrinfo(address, serviceName.c_str(), &hints, &result); + if (errorcode != 0) + { + log_error("Resolving address failed: Code %d.", errorcode); + log_error("Resolution error message: %s.", gai_strerror(errorcode)); + return false; + } if (result == nullptr) { return false;