diff options
author | millert@openbsd.org <millert@openbsd.org> | 2016-02-01 21:18:17 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-02-05 10:44:42 +1100 |
commit | 5658ef2501e785fbbdf5de2dc33b1ff7a4dca73a (patch) | |
tree | bccb7513f721d70d8ac7512781cae0f39b58fd8f | |
parent | 537f88ec7bcf40bd444ac5584c707c5588c55c43 (diff) |
upstream commit
Avoid ugly "DISPLAY "(null)" invalid; disabling X11
forwarding" message when DISPLAY is not set. This could also result in a
crash on systems with a printf that doesn't handle NULL. OK djm@
Upstream-ID: 20ee0cfbda678a247264c20ed75362042b90b412
-rw-r--r-- | clientloop.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clientloop.c b/clientloop.c index f8f9a3f2a..f0a08f234 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.282 2016/01/29 23:04:46 dtucker Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.283 2016/02/01 21:18:17 millert Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -318,8 +318,9 @@ client_x11_get_proto(const char *display, const char *xauth_path, | |||
318 | proto[0] = data[0] = xauthfile[0] = xauthdir[0] = '\0'; | 318 | proto[0] = data[0] = xauthfile[0] = xauthdir[0] = '\0'; |
319 | 319 | ||
320 | if (!client_x11_display_valid(display)) { | 320 | if (!client_x11_display_valid(display)) { |
321 | logit("DISPLAY \"%s\" invalid; disabling X11 forwarding", | 321 | if (display != NULL) |
322 | display); | 322 | logit("DISPLAY \"%s\" invalid; disabling X11 forwarding", |
323 | display); | ||
323 | return -1; | 324 | return -1; |
324 | } | 325 | } |
325 | if (xauth_path != NULL && stat(xauth_path, &st) == -1) { | 326 | if (xauth_path != NULL && stat(xauth_path, &st) == -1) { |