mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
Don't completely ignore unknown types of SSH_MSG_CHANNEL_EXTENDED_DATA.
It's important to do the usual window accounting in all cases. We still ignore the data themselves, which I think is the right thing to do.
This commit is contained in:
parent
f0f191466a
commit
4115ab6e2e
11
ssh.c
11
ssh.c
@ -8064,20 +8064,21 @@ static void ssh2_msg_channel_data(Ssh ssh, struct Packet *pktin)
|
|||||||
{
|
{
|
||||||
char *data;
|
char *data;
|
||||||
int length;
|
int length;
|
||||||
|
unsigned ext_type = 0; /* 0 means not extended */
|
||||||
struct ssh_channel *c;
|
struct ssh_channel *c;
|
||||||
c = ssh_channel_msg(ssh, pktin);
|
c = ssh_channel_msg(ssh, pktin);
|
||||||
if (!c)
|
if (!c)
|
||||||
return;
|
return;
|
||||||
if (pktin->type == SSH2_MSG_CHANNEL_EXTENDED_DATA &&
|
if (pktin->type == SSH2_MSG_CHANNEL_EXTENDED_DATA)
|
||||||
ssh_pkt_getuint32(pktin) != SSH2_EXTENDED_DATA_STDERR)
|
ext_type = ssh_pkt_getuint32(pktin);
|
||||||
return; /* extended but not stderr */
|
|
||||||
ssh_pkt_getstring(pktin, &data, &length);
|
ssh_pkt_getstring(pktin, &data, &length);
|
||||||
if (data) {
|
if (data) {
|
||||||
int bufsize;
|
int bufsize;
|
||||||
c->v.v2.locwindow -= length;
|
c->v.v2.locwindow -= length;
|
||||||
c->v.v2.remlocwin -= length;
|
c->v.v2.remlocwin -= length;
|
||||||
bufsize = ssh_channel_data(c, pktin->type ==
|
if (ext_type != 0 && ext_type != SSH2_EXTENDED_DATA_STDERR)
|
||||||
SSH2_MSG_CHANNEL_EXTENDED_DATA,
|
length = 0; /* Don't do anything with unknown extended data. */
|
||||||
|
bufsize = ssh_channel_data(c, ext_type == SSH2_EXTENDED_DATA_STDERR,
|
||||||
data, length);
|
data, length);
|
||||||
/*
|
/*
|
||||||
* If it looks like the remote end hit the end of its window,
|
* If it looks like the remote end hit the end of its window,
|
||||||
|
Loading…
Reference in New Issue
Block a user