Permalink
Browse files

Revert "Fix mosh-server segfault on startup when run without arguments"

This reverts commit 578db45.

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 <andersk@mit.edu>
  • Loading branch information...
1 parent 578db45 commit 5532117984e22d5a841efc667d27294dbd4d51d4 @andersk andersk committed Jan 4, 2014
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/network/network.cc
View
@@ -205,8 +205,7 @@ class AddrInfo {
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 );
}

0 comments on commit 5532117

Please sign in to comment.