mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 07:37:52 +00:00
Forbid download not precached files
This commit is contained in:
parent
6ae44d7577
commit
30771fefa6
@ -1831,6 +1831,26 @@ static qboolean SV_DownloadFile_f( sv_client_t *cl )
|
|||||||
{
|
{
|
||||||
if( sv_send_resources.value )
|
if( sv_send_resources.value )
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
// security: allow download only precached resources
|
||||||
|
for( i = 0; i < sv.num_resources; i++ )
|
||||||
|
{
|
||||||
|
const char *cmpname = name;
|
||||||
|
|
||||||
|
if( sv.resources[i].type == t_sound )
|
||||||
|
cmpname += sizeof( DEFAULT_SOUNDPATH ); // cut "sound/" off
|
||||||
|
|
||||||
|
if( !Q_strncmp( sv.resources[i].szFileName, cmpname, 64 ) )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( i == sv.num_resources )
|
||||||
|
{
|
||||||
|
SV_FailDownload( cl, name );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// also check the model textures
|
// also check the model textures
|
||||||
if( !Q_stricmp( COM_FileExtension( name ), "mdl" ))
|
if( !Q_stricmp( COM_FileExtension( name ), "mdl" ))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user