Permalink
Browse files

Fix mosh-server segfault on startup when run without arguments

  • Loading branch information...
1 parent 96bf5af commit 578db45fbf65d4e90bba371fe8d55f0455193a27 @keithw keithw committed Jan 4, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/network/network.cc
@@ -205,7 +205,8 @@ class AddrInfo {
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 );
}

0 comments on commit 578db45

Please sign in to comment.