From 762096628c69867f24bd0676520b7f3a811c6072 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sun, 16 Oct 2022 21:43:26 +0200 Subject: [PATCH] os/connection: don't leave `port` uninitialized If DISPLAY is set but does not start with `/`, `port` is now initialized. Fixes 83d0d911069d502232d719882cd1c5cd090defa1 --- os/connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/connection.c b/os/connection.c index 55f1cd32e..1d92b6013 100644 --- a/os/connection.c +++ b/os/connection.c @@ -1018,7 +1018,7 @@ ListenOnOpenFD(int fd, int noxauth) } } - if (!display_env) { + if (!display_env || display_env[0] != '/') { /* Just some default so things don't break and die. */ snprintf(port, sizeof(port), ":%d", atoi(display)); }