mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Fix an assert() in memdbTruncate() that could fail when processing a corrupt database.
FossilOrigin-Name: b1e2929860557cf88f98f0a4f2472e1a16be126bbb8050f0d728350f0cfe987a
This commit is contained in:
@@ -331,8 +331,9 @@ static int memdbTruncate(sqlite3_file *pFile, sqlite_int64 size){
|
||||
MemStore *p = ((MemFile*)pFile)->pStore;
|
||||
int rc = SQLITE_OK;
|
||||
memdbEnter(p);
|
||||
if( NEVER(size>p->sz) ){
|
||||
rc = SQLITE_FULL;
|
||||
if( size>p->sz ){
|
||||
/* This can only happen with a corrupt wal mode db */
|
||||
rc = SQLITE_CORRUPT;
|
||||
}else{
|
||||
p->sz = size;
|
||||
}
|
||||
|
Reference in New Issue
Block a user