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

Improved detection of database corruption.

FossilOrigin-Name: c7fae46c8a3bd78adc5a01340eff6c1efa75f9384dc7f42cb81717b029e7c56f
This commit is contained in:
drh
2021-10-08 16:15:17 +00:00
parent 074a131245
commit 635480ef47
3 changed files with 11 additions and 8 deletions

View File

@@ -8969,7 +8969,10 @@ int sqlite3BtreeInsert(
idx = pCur->ix;
if( loc==0 ){
CellInfo info;
assert( idx<pPage->nCell );
assert( idx>=0 );
if( idx>=pPage->nCell ){
return SQLITE_CORRUPT_BKPT;
}
rc = sqlite3PagerWrite(pPage->pDbPage);
if( rc ){
goto end_insert;