Quote XAuthLocation before use (#442)

This commit is contained in:
Rafael Rivera 2021-05-03 18:26:47 -07:00 committed by GitHub
parent 747d7ee66c
commit 4c37fb9792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -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 : "",