From: drh <> Date: Tue, 19 May 2026 18:45:05 +0000 (+0000) Subject: Fix an assertion fault that can occur in RTree given a carefully X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=d58b463ffbf5d98f45c96dcd503bb7db7ad7ba4a;p=thirdparty%2Fsqlite.git Fix an assertion fault that can occur in RTree given a carefully corrupted database. [bugs:/forumpost/2026-05-18T06:46:01Z|Bug report 2026-05-18T06:46:01Z]. FossilOrigin-Name: 7cf841f3613c8302a419638bdec83b1b9799f00cfedbfe40dca0a1a005c196b5 --- diff --git a/ext/rtree/rtree.c b/ext/rtree/rtree.c index faebdce78d..78d561a956 100644 --- a/ext/rtree/rtree.c +++ b/ext/rtree/rtree.c @@ -1665,6 +1665,10 @@ static int rtreeStepToLeaf(RtreeCursor *pCur){ if( rc ) return rc; nCell = NCELL(pNode); assert( nCell<200 ); + if( nCell>RTREE_MAXCELLS ){ + RTREE_IS_CORRUPT(pRtree); + return SQLITE_CORRUPT_VTAB; + } pCellData = pNode->zData + (4+pRtree->nBytesPerCell*p->iCell); while( p->iCell