mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Detect an attempt to drop a btree that is not within the bounds of the
database file and abort early with an SQLITE_CORRUPT error, to avoid problems later on in the process. FossilOrigin-Name: 235a9698f5e9b3c21dc51c9c5042becfb82fc1762a7519a46b9f9fdafe9b0f13
This commit is contained in:
@@ -9268,6 +9268,9 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){
|
||||
assert( sqlite3BtreeHoldsMutex(p) );
|
||||
assert( p->inTrans==TRANS_WRITE );
|
||||
assert( iTable>=2 );
|
||||
if( iTable>btreePagecount(pBt) ){
|
||||
return SQLITE_CORRUPT_BKPT;
|
||||
}
|
||||
|
||||
rc = btreeGetPage(pBt, (Pgno)iTable, &pPage, 0);
|
||||
if( rc ) return rc;
|
||||
|
Reference in New Issue
Block a user