From 38a5f59c7535538cf4e546bcfc99e436d15cedb1 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 22 Apr 2022 17:15:34 +0100 Subject: [PATCH] mainchan.c: defer a couple of ssh_sw_abort. When a subsidiary part of the SSH system wants to abort the whole connection, it's supposed to call ssh_sw_abort_deferred, on pain of free-order confusion. Elsewhere in mainchan.c I was getting this right, but I missed a couple. --- ssh/mainchan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ssh/mainchan.c b/ssh/mainchan.c index 04993620..5c1769ea 100644 --- a/ssh/mainchan.c +++ b/ssh/mainchan.c @@ -296,8 +296,8 @@ static void mainchan_request_response(Channel *chan, bool success) * If there's no remote_cmd2 configured, then we have no * fallback command, so we've run out of options. */ - ssh_sw_abort(mc->ppl->ssh, - "Server refused to start a shell/command"); + ssh_sw_abort_deferred(mc->ppl->ssh, + "Server refused to start a shell/command"); } return; } @@ -310,8 +310,8 @@ static void mainchan_request_response(Channel *chan, bool success) ssh_got_fallback_cmd(mc->ppl->ssh); mainchan_ready(mc); } else { - ssh_sw_abort(mc->ppl->ssh, - "Server refused to start a shell/command"); + ssh_sw_abort_deferred(mc->ppl->ssh, + "Server refused to start a shell/command"); } return; }