mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
micro optimisations for previous security mitigations.
also strtok_r uses its own provided buffer instead of the static one even in a somewhat monothread context, it s still better.
This commit is contained in:
parent
1a1b32961b
commit
d0dc3e9926
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