From 4c37fb9792308bd978e0c8d61c3a352408be268a Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Mon, 3 May 2021 18:26:47 -0700 Subject: [PATCH] Quote XAuthLocation before use (#442) --- clientloop.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/clientloop.c b/clientloop.c index cb3ff8645..f23530b64 100644 --- a/clientloop.c +++ b/clientloop.c @@ -349,7 +349,11 @@ client_x11_get_proto(struct ssh *ssh, const char *display, /* Don't overflow on long timeouts */ x11_timeout_real = UINT_MAX; } +#ifdef WINDOWS + xasprintf(&cmd, "\"%s\" -f %s generate %s %s " +#else xasprintf(&cmd, "%s -f %s generate %s %s " +#endif "untrusted timeout %u 2>%s", xauth_path, xauthfile, display, SSH_X11_PROTO, x11_timeout_real, @@ -378,7 +382,11 @@ client_x11_get_proto(struct ssh *ssh, const char *display, */ if (trusted || generated) { xasprintf(&cmd, - "%s %s%s list %s 2>" _PATH_DEVNULL, +#ifdef WINDOWS + "\"%s\" %s%s list %s 2>" _PATH_DEVNULL, +#else + "%s %s%s list %s 2>" _PATH_DEVNULL, +#endif xauth_path, generated ? "-f " : "" , generated ? xauthfile : "",