From 8d7150b1ac56a33caec3b64c4adad0cf431b2b2c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 13 Oct 2018 16:30:59 +0100 Subject: [PATCH] Fix segfault in SSH-1 X forwarding. The SSH-1 SshChannel vtable didn't bother to provide the window_override_removed method, because I wrongly remembered that it was only called when connection sharing. In fact, it's _called_ in any X forwarding, but it only has to _do_ anything when connection sharing: SSH-1 has to provide an empty implementation to avoid segfaulting by calling a null function pointer. --- ssh1connection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssh1connection.c b/ssh1connection.c index e493b513..9a5eb363 100644 --- a/ssh1connection.c +++ b/ssh1connection.c @@ -177,6 +177,7 @@ static void ssh1channel_write_eof(SshChannel *c); static void ssh1channel_unclean_close(SshChannel *c, const char *err); static void ssh1channel_unthrottle(SshChannel *c, int bufsize); static Conf *ssh1channel_get_conf(SshChannel *c); +static void ssh1channel_window_override_removed(SshChannel *c) { /* ignore */ } static const struct SshChannelVtable ssh1channel_vtable = { ssh1channel_write, @@ -184,8 +185,7 @@ static const struct SshChannelVtable ssh1channel_vtable = { ssh1channel_unclean_close, ssh1channel_unthrottle, ssh1channel_get_conf, - NULL /* window_override_removed is only used by SSH-2 sharing */, - NULL /* x11_sharing_handover, likewise */, + ssh1channel_window_override_removed, }; static void ssh1_channel_init(struct ssh1_channel *c);