From 4135e5d29550654227e275907e63a58e232cce38 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 8 May 2019 08:30:10 +0100 Subject: [PATCH] pscp: clear act->buf after receiving 'T' command. Without this missing line, if you tried to download a file in SCP mode using the -p option, the payload of the 'T' command (file times) would still be sitting in act->buf when we went back round the loop, so the payload of the followup 'C' or 'D' would be appended to it, leading to a massive misparse and a complaint about illegal file renaming. --- pscp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pscp.c b/pscp.c index 8a19c7f4..230f15d1 100644 --- a/pscp.c +++ b/pscp.c @@ -1405,6 +1405,7 @@ int scp_get_sink_action(struct scp_sink_action *act) &act->mtime, &act->atime) == 2) { act->settime = true; backend_send(backend, "", 1); + act->buf->len = 0; continue; /* go round again */ } bump("Protocol error: Illegal time format");