From b26bd60df9d172f0ee9f83ee3c1ce42709cb33ee Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 7 Feb 2018 19:56:28 +0000 Subject: [PATCH] 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. --- ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssh.c b/ssh.c index 9fcfe9e3..6c8e736c 100644 --- a/ssh.c +++ b/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) { - 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)