mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-28 15:21:57 +00:00
Merge pull request #1116 from devnexen/prev_fix_sec_optim
micro optimisations for previous security mitigations.
This commit is contained in:
commit
a315b15494
2 changed files with 2 additions and 2 deletions
|
@ -555,7 +555,7 @@ CL_DownloadFilter(const char *filename)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strstr(filename, "..") || strstr(filename, ":") || (*filename == '.') || (*filename == '/'))
|
if (strstr(filename, "..") || strchr(filename, ':') || (*filename == '.') || (*filename == '/'))
|
||||||
{
|
{
|
||||||
Com_Printf("Refusing to download a path containing '..' or ':' or starting with '.' or '/': %s\n", filename);
|
Com_Printf("Refusing to download a path containing '..' or ':' or starting with '.' or '/': %s\n", filename);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -406,7 +406,7 @@ QAL_Init()
|
||||||
/* DEFAULT_OPENAL_DRIVER is defined at compile time via the compiler */
|
/* DEFAULT_OPENAL_DRIVER is defined at compile time via the compiler */
|
||||||
al_driver = Cvar_Get("al_driver", DEFAULT_OPENAL_DRIVER, CVAR_ARCHIVE);
|
al_driver = Cvar_Get("al_driver", DEFAULT_OPENAL_DRIVER, CVAR_ARCHIVE);
|
||||||
|
|
||||||
if (strstr(al_driver->string, "..") || strstr(al_driver->string, ":") || strstr(al_driver->string, "/") || strstr(al_driver->string, "\\"))
|
if (strstr(al_driver->string, "..") || strchr(al_driver->string, ':') || strchr(al_driver->string, '/') || strchr(al_driver->string, '\\'))
|
||||||
{
|
{
|
||||||
Com_Printf("al_driver must not contain '..', ':', '/' or '\': %s\n", al_driver->string);
|
Com_Printf("al_driver must not contain '..', ':', '/' or '\': %s\n", al_driver->string);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue