Skip to content

Commit c8f051e

Browse files
author
D. Richard Hipp
committed
Improved detection of corrupt node IDs in RTree shadow tables.
Test case in TH3.
1 parent 6e2e125 commit c8f051e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ext/rtree/rtree.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,9 @@ static int nodeAcquire(
761761
rc = SQLITE_CORRUPT_VTAB;
762762
RTREE_IS_CORRUPT(pRtree);
763763
}
764+
}else if( iNode<=0 ){
765+
RTREE_IS_CORRUPT(pRtree);
766+
rc = SQLITE_CORRUPT_VTAB;
764767
}else if( pRtree->iNodeSize==sqlite3_blob_bytes(pRtree->pNodeBlob) ){
765768
pNode = (RtreeNode *)sqlite3_malloc64(sizeof(RtreeNode)+pRtree->iNodeSize);
766769
if( !pNode ){

0 commit comments

Comments
 (0)