diff --git a/ssh2connection.c b/ssh2connection.c index 1a40ca7e..925b5ec9 100644 --- a/ssh2connection.c +++ b/ssh2connection.c @@ -535,6 +535,17 @@ static bool ssh2_connection_filter_queue(struct ssh2_connection_state *s) c->chan, ext_type == SSH2_EXTENDED_DATA_STDERR, data.ptr, data.len); + /* + * The channel may have turned into a connection- + * shared one as a result of that chan_send, e.g. + * if the data we just provided completed the X11 + * auth phase and caused a callback to + * x11_sharing_handover. If so, do nothing + * further. + */ + if (c->sharectx) + break; + /* * If it looks like the remote end hit the end of * its window, and we didn't want it to do that,