From 578db45fbf65d4e90bba371fe8d55f0455193a27 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Sat, 4 Jan 2014 03:08:57 -0500 Subject: [PATCH] Fix mosh-server segfault on startup when run without arguments --- src/network/network.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/network.cc b/src/network/network.cc index c269866..d9d4678 100644 --- a/src/network/network.cc +++ b/src/network/network.cc @@ -205,7 +205,8 @@ public: AddrInfo( const char *node, const char *service, const struct addrinfo *hints ) : res( NULL ) { - int errcode = getaddrinfo( node, service, hints, &res ); + int errcode = getaddrinfo( node ? node : "0", + service ? service : "0", hints, &res ); if ( errcode != 0 ) { throw NetworkException( std::string( "Bad IP address (" ) + node + "): " + gai_strerror( errcode ), 0 ); }