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

Return SQLITE_CORRUPT to the user if an attempt is made to add database page 1 to the free page list.

FossilOrigin-Name: 68876003f922635737349f55bc73a78891ea7028
This commit is contained in:
dan
2015-05-26 12:18:17 +00:00
parent c5b7358513
commit fb0246ba8a
4 changed files with 36 additions and 9 deletions

View File

@@ -5600,9 +5600,10 @@ static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){
int nFree; /* Initial number of pages on free-list */
assert( sqlite3_mutex_held(pBt->mutex) );
assert( iPage>1 );
assert( CORRUPT_DB || iPage>1 );
assert( !pMemPage || pMemPage->pgno==iPage );
if( iPage<2 ) return SQLITE_CORRUPT_BKPT;
if( pMemPage ){
pPage = pMemPage;
sqlite3PagerRef(pPage->pDbPage);