1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00

Bug 1675: Prevent SCP server sending files that were not requested

https://winscp.net/tracker/1675

Source commit: 4aa587620973bf793fb6e783052277c0f7be4b55
This commit is contained in:
Martin Prikryl
2018-09-03 12:50:44 +00:00
parent ec5977ba27
commit 49d876f2c5
3 changed files with 6 additions and 0 deletions

View File

@@ -2361,6 +2361,10 @@ void __fastcall TSCPFileSystem::SCPSink(const UnicodeString TargetDir,
{
FTerminal->LogEvent(FORMAT(L"Warning: Remote host set a compound pathname '%s'", (Line)));
}
if ((Level == 0) && (OnlyFileName != UnixExtractFileName(FileName)))
{
SCPError(LoadStr(UNREQUESTED_FILE), False);
}
FullFileName = SourceDir + OnlyFileName;
OperationProgress->SetFile(FullFileName);