mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Avoid logging zero-length strings of outgoing raw data.
In the 'SSH packets + raw data' logging mode, one of these occurs immediately after the initial key exchange, at the point where the transport routine releases any queued higher-layer packets that had been waiting for KEX to complete. Of course, in the initial KEX there are never any of those, so we do a zero-length s_write(), which is harmless but has the side effect of a zero-length raw-data log entry.
This commit is contained in:
parent
6c4d3cb8f3
commit
b26bd60df9
2
ssh.c
2
ssh.c
@ -2032,7 +2032,7 @@ static int s_wrpkt_prepare(Ssh ssh, struct Packet *pkt, int *offset_p)
|
|||||||
|
|
||||||
static int s_write(Ssh ssh, void *data, int len)
|
static int s_write(Ssh ssh, void *data, int len)
|
||||||
{
|
{
|
||||||
if (ssh->logctx)
|
if (len && ssh->logctx)
|
||||||
log_packet(ssh->logctx, PKT_OUTGOING, -1, NULL, data, len,
|
log_packet(ssh->logctx, PKT_OUTGOING, -1, NULL, data, len,
|
||||||
0, NULL, NULL, 0, NULL);
|
0, NULL, NULL, 0, NULL);
|
||||||
if (!ssh->s)
|
if (!ssh->s)
|
||||||
|
Loading…
Reference in New Issue
Block a user