Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Maintenance:6712
sqlite3.openSUSE_Leap_42.1_Update
sqlite3-CVE-2016-6153.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sqlite3-CVE-2016-6153.patch of Package sqlite3.openSUSE_Leap_42.1_Update
--- sqlite3.c.orig +++ sqlite3.c @@ -30882,27 +30882,29 @@ static const char *unixTempFileDir(void) static const char *azDirs[] = { 0, 0, - 0, "/var/tmp", "/usr/tmp", "/tmp", - 0 /* List terminator */ + "." }; - unsigned int i; + unsigned int i = 0; struct stat buf; - const char *zDir = 0; + const char *zDir = sqlite3_temp_directory; - azDirs[0] = sqlite3_temp_directory; - if( !azDirs[1] ) azDirs[1] = getenv("SQLITE_TMPDIR"); - if( !azDirs[2] ) azDirs[2] = getenv("TMPDIR"); - for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); zDir=azDirs[i++]){ - if( zDir==0 ) continue; - if( osStat(zDir, &buf) ) continue; - if( !S_ISDIR(buf.st_mode) ) continue; - if( osAccess(zDir, 07) ) continue; - break; + if( !azDirs[0] ) azDirs[0] = getenv("SQLITE_TMPDIR"); + if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR"); + while(1){ + if( zDir!=0 + && osStat(zDir, &buf)==0 + && S_ISDIR(buf.st_mode) + && osAccess(zDir, 03)==0 + ){ + return zDir; + } + if( i>=sizeof(azDirs)/sizeof(azDirs[0]) ) break; + zDir = azDirs[i++]; } - return zDir; + return 0; } /* @@ -30922,10 +30924,11 @@ static int unixGetTempname(int nBuf, cha ** using the io-error infrastructure to test that SQLite handles this ** function failing. */ + zBuf[0] = 0; SimulateIOError( return SQLITE_IOERR ); zDir = unixTempFileDir(); - if( zDir==0 ) zDir = "."; + if( zDir==0 ) return SQLITE_IOERR_GETTEMPPATH; /* Check that the output buffer is large enough for the temporary file ** name. If it is not, return SQLITE_ERROR.
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor