1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-22 14:39:24 -05:00

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.
This commit is contained in:
Simon Tatham 2019-05-08 08:30:10 +01:00
parent 57c45c620f
commit 4135e5d295

1
pscp.c
View File

@ -1405,6 +1405,7 @@ int scp_get_sink_action(struct scp_sink_action *act)
&act->mtime, &act->atime) == 2) { &act->mtime, &act->atime) == 2) {
act->settime = true; act->settime = true;
backend_send(backend, "", 1); backend_send(backend, "", 1);
act->buf->len = 0;
continue; /* go round again */ continue; /* go round again */
} }
bump("Protocol error: Illegal time format"); bump("Protocol error: Illegal time format");