Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 5532117984e22d5a841efc667d27294dbd4d51d4 1 parent 578db45
@andersk andersk authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  src/network/network.cc
View
3  src/network/network.cc
@@ -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 );
}
Please sign in to comment.
Something went wrong with that request. Please try again.