mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Fix an assert() that may be false for corrupt databases.
FossilOrigin-Name: b2ce5ed175cb5029ac07392ae371c86eeec23c74624aad007dee51cf359f3eeb
This commit is contained in:
@@ -4284,10 +4284,9 @@ int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){
|
||||
rc = newDatabase(pBt);
|
||||
pBt->nPage = get4byte(28 + pBt->pPage1->aData);
|
||||
|
||||
/* The database size was written into the offset 28 of the header
|
||||
** when the transaction started, so we know that the value at offset
|
||||
** 28 is nonzero. */
|
||||
assert( pBt->nPage>0 );
|
||||
/* pBt->nPage might be zero if the database was corrupt when
|
||||
** the transaction was started. Otherwise, it must be at least 1. */
|
||||
assert( CORRUPT_DB || pBt->nPage>0 );
|
||||
}
|
||||
sqlite3BtreeLeave(p);
|
||||
}
|
||||
|
Reference in New Issue
Block a user