diff --git a/ssh.c b/ssh.c index fa9bc745..e6b2d6be 100644 --- a/ssh.c +++ b/ssh.c @@ -1762,6 +1762,8 @@ static int s_write(Ssh ssh, void *data, int len) if (ssh->logctx) log_packet(ssh->logctx, PKT_OUTGOING, -1, NULL, data, len, 0, NULL, NULL); + if (!ssh->s) + return 0; return sk_write(ssh->s, (char *)data, len); }