1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Earlier detection of corruption while added to the freelist.

FossilOrigin-Name: 8c80b004cae71aaf820a31dba80c100ed162ef5bae845fb4535ff4d3be407500
This commit is contained in:
drh
2019-03-25 19:50:19 +00:00
parent 1c960269dd
commit 58b42ad131
4 changed files with 11 additions and 9 deletions

View File

@@ -6193,7 +6193,9 @@ static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){
assert( CORRUPT_DB || iPage>1 );
assert( !pMemPage || pMemPage->pgno==iPage );
if( iPage<2 ) return SQLITE_CORRUPT_BKPT;
if( iPage<2 || iPage>pBt->nPage ){
return SQLITE_CORRUPT_BKPT;
}
if( pMemPage ){
pPage = pMemPage;
sqlite3PagerRef(pPage->pDbPage);