From b39da20edc6025a9120e5959ea2e4dc8f0bd7604 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 4 Jan 2014 04:18:26 -0500 Subject: [PATCH] AddrInfo: Fix error message generation when node == NULL Signed-off-by: Anders Kaseorg --- src/network/network.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/network.cc b/src/network/network.cc index c269866..714005a 100644 --- a/src/network/network.cc +++ b/src/network/network.cc @@ -207,7 +207,7 @@ public: res( NULL ) { int errcode = getaddrinfo( node, service, hints, &res ); if ( errcode != 0 ) { - throw NetworkException( std::string( "Bad IP address (" ) + node + "): " + gai_strerror( errcode ), 0 ); + throw NetworkException( std::string( "Bad IP address (" ) + (node != NULL ? node : "(null)") + "): " + gai_strerror( errcode ), 0 ); } } ~AddrInfo() { freeaddrinfo(res); }