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

More aggressive detection of database corruption in the rebuildPage() routine.

FossilOrigin-Name: a18c65068b16eae3c0725356d7f4775774b23e248c700cef8c15f23459fba68f
This commit is contained in:
drh
2021-04-20 20:48:15 +00:00
parent 5b482a9832
commit 8cae5a4a47
3 changed files with 9 additions and 9 deletions

View File

@@ -7015,7 +7015,7 @@ static int rebuildPage(
u8 *pCell = pCArray->apCell[i];
u16 sz = pCArray->szCell[i];
assert( sz>0 );
if( SQLITE_WITHIN(pCell,aData,pEnd) ){
if( SQLITE_WITHIN(pCell,aData+j,pEnd) ){
if( ((uptr)(pCell+sz))>(uptr)pEnd ) return SQLITE_CORRUPT_BKPT;
pCell = &pTmp[pCell - aData];
}else if( (uptr)(pCell+sz)>(uptr)pSrcEnd