1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix an assert() in the pager by adding "|| CORRUPT_DB", in as much as the

assert() is not necessarily true if the database size in the header is
wrong.  dbsqlfuzz f2f996065b90988aa9b0ae425b66dbb296546a08.

FossilOrigin-Name: a51402e8c29fad2b24e32de55b10691fb0ebd6c2cebac941e43e54be211d5d39
This commit is contained in:
drh
2022-02-11 17:33:02 +00:00
parent 63a47336af
commit 4ba1c5cc49
3 changed files with 9 additions and 9 deletions

View File

@@ -3945,7 +3945,7 @@ static void assertTruncateConstraint(Pager *pPager){
** then continue writing to the database.
*/
void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){
assert( pPager->dbSize>=nPage );
assert( pPager->dbSize>=nPage || CORRUPT_DB );
assert( pPager->eState>=PAGER_WRITER_CACHEMOD );
pPager->dbSize = nPage;