1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38: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:
Simon Tatham 2018-02-07 19:56:28 +00:00
parent 6c4d3cb8f3
commit b26bd60df9

2
ssh.c
View File

@ -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)
{
if (ssh->logctx)
if (len && ssh->logctx)
log_packet(ssh->logctx, PKT_OUTGOING, -1, NULL, data, len,
0, NULL, NULL, 0, NULL);
if (!ssh->s)