SQLite

Check-in [0bf4c70a68]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the node hash function in RTREE to ensure that it always returns a non-negative value.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0bf4c70a6849da74797e8616a4f3730492ad02882ae67a0fe0f3b3cc3f1043b4
User & Date: drh 2018-12-21 18:17:35.643
Context
2018-12-21
18:50
The fts4umlaut.test module requires FTS5, so do not try to run it without that module. (check-in: dee3ae9001 user: drh tags: trunk)
18:17
Fix the node hash function in RTREE to ensure that it always returns a non-negative value. (check-in: 0bf4c70a68 user: drh tags: trunk)
17:51
Fix a potential NULL-pointer deference in RTREE due to corrupt shadow tables. (check-in: 1fdd3604ee user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/rtree/rtree.c.
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
  p->isDirty = 1;
}

/*
** Given a node number iNode, return the corresponding key to use
** in the Rtree.aHash table.
*/
static int nodeHash(i64 iNode){
  return iNode % HASHSIZE;
}

/*
** Search the node hash table for node iNode. If found, return a pointer
** to it. Otherwise, return 0.
*/
static RtreeNode *nodeHashLookup(Rtree *pRtree, i64 iNode){







|
|







561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
  p->isDirty = 1;
}

/*
** Given a node number iNode, return the corresponding key to use
** in the Rtree.aHash table.
*/
static unsigned int nodeHash(i64 iNode){
  return ((unsigned)iNode) % HASHSIZE;
}

/*
** Search the node hash table for node iNode. If found, return a pointer
** to it. Otherwise, return 0.
*/
static RtreeNode *nodeHashLookup(Rtree *pRtree, i64 iNode){