]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
reject downloads of non-regular files
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 Jan 2009 13:10:42 +0000 (13:10 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 Jan 2009 13:10:42 +0000 (13:10 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8636 d7cf8633-e32d-0410-b094-e92efae38249

sv_main.c

index 4e541af0153185e5b643431b119174e230716519..9ca62e2c4008020a9a023ef33148b49c74f59443 100644 (file)
--- 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);