summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2016-02-01 21:18:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2016-02-01 21:18:18 +0000
commit0ddbe900412555fcbbc38dad10654f6d0a58d580 (patch)
tree2786d3e1bd2de6e76c5a83fb732ba699d1968817
parent16aabe637861b2d122a4738f05436630725e8af4 (diff)
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@
-rw-r--r--usr.bin/ssh/clientloop.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index 9bdd5e322cb..10aebd68d5e 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.282 2016/01/29 23:04:46 dtucker Exp $ */
+/* $OpenBSD: clientloop.c,v 1.283 2016/02/01 21:18:17 millert Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -310,8 +310,9 @@ client_x11_get_proto(const char *display, const char *xauth_path,
proto[0] = data[0] = xauthfile[0] = xauthdir[0] = '\0';
if (!client_x11_display_valid(display)) {
- logit("DISPLAY \"%s\" invalid; disabling X11 forwarding",
- display);
+ if (display != NULL)
+ logit("DISPLAY \"%s\" invalid; disabling X11 forwarding",
+ display);
return -1;
}
if (xauth_path != NULL && stat(xauth_path, &st) == -1) {