Fix a problem with corrupt fts3 database detection introduced by [95a9a39f].

FossilOrigin-Name: c80bb15b44e9b6a3c0c5a49d5e93e66376c3520ecefc1db7425c8a7e09d3eade
This commit is contained in:
dan
2018-12-26 14:15:09 +00:00
parent 8625221444
commit d8f3b4c320
4 changed files with 92 additions and 10 deletions
+1 -1
View File
@@ -1409,7 +1409,7 @@ static int fts3SegReaderNext(
** b-tree node. And that the final byte of the doclist is 0x00. If either
** of these statements is untrue, then the data structure is corrupt.
*/
if( pReader->nDoclist-(pReader->aDoclist-pReader->aNode) > pReader->nNode
if( pReader->nDoclist > pReader->nNode-(pReader->aDoclist-pReader->aNode)
|| (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1])
){
return FTS_CORRUPT_VTAB;