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