Skip to content

Commit

Permalink
Don't look for DLLs on current working directory anymore, for securit…
Browse files Browse the repository at this point in the history
…y reasons.
  • Loading branch information
Thilo Schulz committed Oct 17, 2009
1 parent 504bd58 commit b9ec0e4
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions code/sys/sys_main.c
Expand Up @@ -381,9 +381,8 @@ static void* Sys_TryLibraryLoad(const char* base, const char* gamedir, const cha
Sys_LoadDll
Used to load a development dll instead of a virtual machine
#1 look down current path
#2 look in fs_homepath
#3 look in fs_basepath
#1 look in fs_homepath
#2 look in fs_basepath
=================
*/
void *Sys_LoadDll( const char *name, char *fqpath ,
Expand All @@ -395,23 +394,18 @@ void *Sys_LoadDll( const char *name, char *fqpath ,
char fname[MAX_OSPATH];
char *basepath;
char *homepath;
char *pwdpath;
char *gamedir;

assert( name );

Q_snprintf (fname, sizeof(fname), "%s" ARCH_STRING DLL_EXT, name);

// TODO: use fs_searchpaths from files.c
pwdpath = Sys_Cwd();
basepath = Cvar_VariableString( "fs_basepath" );
homepath = Cvar_VariableString( "fs_homepath" );
gamedir = Cvar_VariableString( "fs_game" );

libHandle = Sys_TryLibraryLoad(pwdpath, gamedir, fname, fqpath);

if(!libHandle && homepath)
libHandle = Sys_TryLibraryLoad(homepath, gamedir, fname, fqpath);
libHandle = Sys_TryLibraryLoad(homepath, gamedir, fname, fqpath);

if(!libHandle && basepath)
libHandle = Sys_TryLibraryLoad(basepath, gamedir, fname, fqpath);
Expand Down

0 comments on commit b9ec0e4

Please sign in to comment.