Merge pull request #1116 from devnexen/prev_fix_sec_optim

micro optimisations for previous security mitigations.
This commit is contained in:
Yamagi 2024-06-30 20:54:08 +02:00 committed by GitHub
commit a315b15494
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -555,7 +555,7 @@ CL_DownloadFilter(const char *filename)
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);
return true;

View file

@ -406,7 +406,7 @@ QAL_Init()
/* DEFAULT_OPENAL_DRIVER is defined at compile time via the compiler */
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);
return false;