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