mirror of
https://github.com/openbsd/src.git
synced 2026-06-18 07:13:36 +02:00
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
This commit is contained in:
@@ -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@cs.hut.fi>
|
||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||
@@ -1370,6 +1370,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) {
|
||||
|
||||
Reference in New Issue
Block a user