From: drh <> Date: Tue, 19 May 2026 18:47:37 +0000 (+0000) Subject: Fix an assertion fault that can occur in RTree given a carefully X-Git-Tag: version-3.53.2~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d75e0a89ad7a600c66f53f8f2a83e900e0e20313;p=thirdparty%2Fsqlite.git Fix an assertion fault that can occur in RTree given a carefully corrupted database. FossilOrigin-Name: 0d01c90bd7779192f0541dfc43624f70241c45accf06ad43666310ec50e486d6 --- 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