X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=ssh.c;h=e2b2d0e3dd34e63f900df889a26e0889cc657903;hb=08d4ca078763518ba377ac59a86a1580e6214c27;hp=eea17d010a417af74e9d1fa35c058f02f99d5581;hpb=d17b9733a9307b58ebf96419258d6c4ac3cd04d2;p=PuTTY.git diff --git a/ssh.c b/ssh.c index eea17d01..e2b2d0e3 100644 --- a/ssh.c +++ b/ssh.c @@ -7986,10 +7986,12 @@ static struct ssh_channel *ssh_channel_msg(Ssh ssh, struct Packet *pktin) halfopen_ok = (pktin->type == SSH2_MSG_CHANNEL_OPEN_CONFIRMATION || pktin->type == SSH2_MSG_CHANNEL_OPEN_FAILURE); c = find234(ssh->channels, &localid, ssh_channelfind); - if (!c || (c->type != CHAN_SHARING && c->halfopen && !halfopen_ok)) { + if (!c || (c->type != CHAN_SHARING && (c->halfopen != halfopen_ok))) { char *buf = dupprintf("Received %s for %s channel %u", ssh_pkt_type(ssh, pktin->type), - c ? "half-open" : "nonexistent", localid); + !c ? "nonexistent" : + c->halfopen ? "half-open" : "open", + localid); ssh_disconnect(ssh, NULL, buf, SSH2_DISCONNECT_PROTOCOL_ERROR, FALSE); sfree(buf); return NULL;