From 3c60c0dcd25e2fe9b2d92a8d8115edc62c9da002 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 8 Jan 2009 13:10:42 +0000 Subject: [PATCH] reject downloads of non-regular files git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8636 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sv_main.c b/sv_main.c index 4e541af0..9ca62e2c 100644 --- a/sv_main.c +++ b/sv_main.c @@ -2248,6 +2248,15 @@ static void SV_Download_f(void) return; } + if (FS_FileSize(host_client->download_file) < 0) + { + SV_ClientPrintf("Download rejected: file \"%s\" is not a regular file\n", host_client->download_name); + Host_ClientCommands("\nstopdownload\n"); + FS_Close(host_client->download_file); + host_client->download_file = NULL; + return; + } + Con_DPrintf("Downloading %s to %s\n", host_client->download_name, host_client->name); Host_ClientCommands("\ncl_downloadbegin %i %s\n", (int)FS_FileSize(host_client->download_file), host_client->download_name); -- 2.39.2