mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Make FS_InvalidGameDir() consider subdirectories invalid
fs_game shouldn't be a subdirectory and it simplifies the code.
This commit is contained in:
parent
3d6aa05694
commit
71a9a5efa6
1 changed files with 2 additions and 3 deletions
|
@ -3072,13 +3072,12 @@ qboolean FS_CheckDirTraversal(const char *checkdir)
|
|||
FS_InvalidGameDir
|
||||
|
||||
return true if path is a reference to current directory or directory traversal
|
||||
or a sub-directory
|
||||
================
|
||||
*/
|
||||
qboolean FS_InvalidGameDir( const char *gamedir ) {
|
||||
if ( !strcmp( gamedir, "." ) || !strcmp( gamedir, ".." )
|
||||
|| !strcmp( gamedir, "/" ) || !strcmp( gamedir, "\\" )
|
||||
|| strstr( gamedir, "/.." ) || strstr( gamedir, "\\.." )
|
||||
|| FS_CheckDirTraversal( gamedir ) ) {
|
||||
|| strchr( gamedir, '/' ) || strchr( gamedir, '\\' ) ) {
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue