diff options
author | Zachary Slater <zachary@ioquake.org> | 2012-06-14 18:28:58 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-12 20:30:53 +0000 |
commit | c846c4bd7c090f4e55c847eb693efd5704875a89 (patch) | |
tree | c5f25226a47ca41767fd9de9e8b00d47e7bef3b8 /src | |
parent | c60497449f0f591e61581f5a868ece271c6a1b30 (diff) |
CVE-2012-3345
Diffstat (limited to 'src')
-rw-r--r-- | src/qcommon/qcommon.h | 1 | ||||
-rw-r--r-- | src/sys/sys_main.c | 2 | ||||
-rw-r--r-- | src/sys/sys_osx.m | 22 | ||||
-rw-r--r-- | src/sys/sys_unix.c | 17 | ||||
-rw-r--r-- | src/sys/sys_win32.c | 18 |
5 files changed, 1 insertions, 59 deletions
diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h index 70fb6397..838087b7 100644 --- a/src/qcommon/qcommon.h +++ b/src/qcommon/qcommon.h @@ -1089,7 +1089,6 @@ char *Sys_DefaultAppPath(void); void Sys_SetDefaultHomePath(const char *path); char *Sys_DefaultHomePath(void); -const char *Sys_TempPath(void); const char *Sys_Dirname( char *path ); const char *Sys_Basename( char *path ); char *Sys_ConsoleInput(void); diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c index 0773b483..170107ae 100644 --- a/src/sys/sys_main.c +++ b/src/sys/sys_main.c @@ -141,7 +141,7 @@ Sys_PIDFileName */ static char *Sys_PIDFileName( void ) { - return va( "%s/%s", Sys_TempPath( ), PID_FILENAME ); + return va( "%s/%s", Sys_DefaultHomePath( ), PID_FILENAME ); } /* diff --git a/src/sys/sys_osx.m b/src/sys/sys_osx.m index 1efd08c0..5d567a7f 100644 --- a/src/sys/sys_osx.m +++ b/src/sys/sys_osx.m @@ -37,28 +37,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #import <Cocoa/Cocoa.h> /* -================ -Sys_TempPath -================ -*/ -const char *Sys_TempPath( void ) -{ - static UInt8 posixPath[ MAX_OSPATH ]; - FSRef ref; - if( FSFindFolder( kOnAppropriateDisk, - kTemporaryFolderType, kCreateFolder, &ref ) == noErr ) - { - if( FSRefMakePath( &ref, posixPath, - sizeof( posixPath ) - 1 ) == noErr ) - { - return (const char *)posixPath; - } - } - - return "/tmp"; -} - -/* ============== Sys_Dialog diff --git a/src/sys/sys_unix.c b/src/sys/sys_unix.c index a712e41d..53a86354 100644 --- a/src/sys/sys_unix.c +++ b/src/sys/sys_unix.c @@ -71,23 +71,6 @@ char *Sys_DefaultHomePath(void) return homePath; } -#ifndef MACOS_X -/* -================ -Sys_TempPath -================ -*/ -const char *Sys_TempPath( void ) -{ - const char *TMPDIR = getenv( "TMPDIR" ); - - if( TMPDIR == NULL || TMPDIR[ 0 ] == '\0' ) - return "/tmp"; - else - return TMPDIR; -} -#endif - /* ================ Sys_Milliseconds diff --git a/src/sys/sys_win32.c b/src/sys/sys_win32.c index 25e18424..2fb8b006 100644 --- a/src/sys/sys_win32.c +++ b/src/sys/sys_win32.c @@ -125,24 +125,6 @@ char *Sys_DefaultHomePath( void ) /* ================ -Sys_TempPath -================ -*/ -const char *Sys_TempPath( void ) -{ - static TCHAR path[ MAX_PATH ]; - DWORD length; - - length = GetTempPath( sizeof( path ), path ); - - if( length > sizeof( path ) || length == 0 ) - return Sys_DefaultHomePath( ); - else - return path; -} - -/* -================ Sys_Milliseconds ================ */ |