aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/event/socket.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c
index 82686641c0..997dd29a7f 100644
--- a/src/nvim/event/socket.c
+++ b/src/nvim/event/socket.c
@@ -45,6 +45,12 @@ int socket_watcher_init(Loop *loop, SocketWatcher *watcher,
return UV_EINVAL;
}
+ if (*port == NUL) {
+ // When no port is given, (uv_)getaddrinfo expects NULL otherwise the
+ // implementation may attempt to lookup the service by name (and fail)
+ port = NULL;
+ }
+
uv_getaddrinfo_t request;
int retval = uv_getaddrinfo(&loop->uv, &request, NULL, addr, port,