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

Earlier detection of a specific kind of corruption in the balance_nonroot()

routine.

FossilOrigin-Name: ee6dc9913a8733891576e6e298241f7440209c5e
This commit is contained in:
drh
2015-05-23 19:29:08 +00:00
parent 3c46b7f7fd
commit 3183ac590d
3 changed files with 11 additions and 7 deletions

View File

@@ -6879,6 +6879,10 @@ static int balance_nonroot(
apCell[nCell] = pTemp+leafCorrection;
assert( leafCorrection==0 || leafCorrection==4 );
szCell[nCell] = szCell[nCell] - leafCorrection;
if( szCell[nCell]<3 ){
rc = SQLITE_CORRUPT_BKPT;
goto balance_cleanup;
}
if( !pOld->leaf ){
assert( leafCorrection==0 );
assert( pOld->hdrOffset==0 );