os/connection: don't leave `port` uninitialized

If DISPLAY is set but does not start with `/`, `port` is now
initialized.

Fixes 83d0d91106
This commit is contained in:
Julian Orth 2022-10-16 21:43:26 +02:00 committed by Jeremy Huddleston Sequoia
parent 87e5db75fb
commit 762096628c

View File

@ -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));
}