[openssh-commits] [openssh] branch master updated: upstream: avoid strlen(NULL) crash if an X11 channel was created before

git+noreply at mindrot.org git+noreply at mindrot.org
Sun May 31 16:15:30 AEST 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

The following commit(s) were added to refs/heads/master by this push:
     new a1dd1c806 upstream: avoid strlen(NULL) crash if an X11 channel was created before
a1dd1c806 is described below

commit a1dd1c80687fbfbdca19d3a314a8176b90ae471b
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Sun May 31 06:14:42 2026 +0000

    upstream: avoid strlen(NULL) crash if an X11 channel was created before
    
    the x11-req SSH_MSG_CHANNEL_REQUEST was sent. Reported by Ben Perry via
    GHPR679
    
    OpenBSD-Commit-ID: 31db0da9ab6c73e6bbf4021ffd53dc3ce5c65f23
---
 channels.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/channels.c b/channels.c
index 0d4cc0806..949f57765 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.459 2026/04/20 07:43:52 job Exp $ */
+/* $OpenBSD: channels.c,v 1.460 2026/05/31 06:14:42 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -1376,6 +1376,11 @@ x11_open_helper(struct ssh *ssh, struct sshbuf *b)
 	u_char *ucp;
 	u_int proto_len, data_len;
 
+	if (sc->x11_saved_proto == NULL) {
+		error("X11 forwarding opened before X11 forwarding requested");
+		return -1;
+	}
+
 	/* Is this being called after the refusal deadline? */
 	if (sc->x11_refuse_time != 0 &&
 	    monotime() >= sc->x11_refuse_time) {

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list