From: divverent Date: Thu, 8 Jan 2009 13:10:42 +0000 (+0000) Subject: reject downloads of non-regular files X-Git-Tag: xonotic-v0.1.0preview~1956 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3c60c0dcd25e2fe9b2d92a8d8115edc62c9da002;p=xonotic%2Fdarkplaces.git reject downloads of non-regular files git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8636 d7cf8633-e32d-0410-b094-e92efae38249 --- 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);