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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user