mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
When testing, avoid injecting an OOM fault into a file-control call made by
SQLite on an unopened file-descriptor. FossilOrigin-Name: 9c1a5eba3ec37c877af4b83c6f8c05b7140304f3d23e49832ba63e321247fc8d
This commit is contained in:
2
src/os.c
2
src/os.c
@@ -125,6 +125,7 @@ int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){
|
||||
** routine has no return value since the return value would be meaningless.
|
||||
*/
|
||||
int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
if( id->pMethods==0 ) return SQLITE_NOTFOUND;
|
||||
#ifdef SQLITE_TEST
|
||||
if( op!=SQLITE_FCNTL_COMMIT_PHASETWO
|
||||
&& op!=SQLITE_FCNTL_LOCK_TIMEOUT
|
||||
@@ -142,7 +143,6 @@ int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
DO_OS_MALLOC_TEST(id);
|
||||
}
|
||||
#endif
|
||||
if( id->pMethods==0 ) return SQLITE_NOTFOUND;
|
||||
return id->pMethods->xFileControl(id, op, pArg);
|
||||
}
|
||||
void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){
|
||||
|
Reference in New Issue
Block a user