]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authormillert@openbsd.org <millert@openbsd.org>
Mon, 1 Feb 2016 21:18:17 +0000 (21:18 +0000)
committerDamien Miller <djm@mindrot.org>
Thu, 4 Feb 2016 23:44:42 +0000 (10:44 +1100)
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

clientloop.c

index f8f9a3f2acdacd195f622b23285eb44238f8596f..f0a08f234f7e67ee3ae989e0f74330ec2553803d 100644 (file)
@@ -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
@@ -318,8 +318,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) {