mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Avoid the ldisc passing zero-length strings to back->send(). VMS
sshd has interesting behaviour on receiving a zero-length SSH data packet. [originally from svn r508]
This commit is contained in:
parent
eb79da11de
commit
c9e236eb39
6
ldisc.c
6
ldisc.c
@ -123,7 +123,8 @@ static void term_send(char *buf, int len) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CTRL('M'): /* send with newline */
|
case CTRL('M'): /* send with newline */
|
||||||
back->send(term_buf, term_buflen);
|
if (term_buflen > 0)
|
||||||
|
back->send(term_buf, term_buflen);
|
||||||
if (cfg.protocol == PROT_RAW)
|
if (cfg.protocol == PROT_RAW)
|
||||||
back->send("\r\n", 2);
|
back->send("\r\n", 2);
|
||||||
else
|
else
|
||||||
@ -153,7 +154,8 @@ static void simple_send(char *buf, int len) {
|
|||||||
term_buflen--;
|
term_buflen--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
back->send(buf, len);
|
if (len > 0)
|
||||||
|
back->send(buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ldisc ldisc_term = { term_send };
|
Ldisc ldisc_term = { term_send };
|
||||||
|
Loading…
Reference in New Issue
Block a user