From 5532117984e22d5a841efc667d27294dbd4d51d4 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 4 Jan 2014 04:14:55 -0500 Subject: [PATCH] Revert "Fix mosh-server segfault on startup when run without arguments" This reverts commit 578db45fbf65d4e90bba371fe8d55f0455193a27. The NULL inputs to getaddrinfo are valid in certain cases, and at least in the case of node, important. The segfault happens not with getaddrinfo, but with the error message generation below it. Signed-off-by: Anders Kaseorg --- src/network/network.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/network/network.cc b/src/network/network.cc index d9d4678..c269866 100644 --- a/src/network/network.cc +++ b/src/network/network.cc @@ -205,8 +205,7 @@ public: AddrInfo( const char *node, const char *service, const struct addrinfo *hints ) : res( NULL ) { - int errcode = getaddrinfo( node ? node : "0", - service ? service : "0", hints, &res ); + int errcode = getaddrinfo( node, service, hints, &res ); if ( errcode != 0 ) { throw NetworkException( std::string( "Bad IP address (" ) + node + "): " + gai_strerror( errcode ), 0 ); }