1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Further improve detection of corrupt records in fts3.

FossilOrigin-Name: a0f6d526baecd061a5e2bec5eb698fb5dfb10122ac79c853d7b3f4a48bc9f49b
This commit is contained in:
dan
2019-11-20 13:31:52 +00:00
parent 594b124f21
commit 70d1a1a3ed
4 changed files with 11 additions and 11 deletions

View File

@ -2025,7 +2025,7 @@ static int fts3SelectLeaf(
if( rc==SQLITE_OK ){
int iNewHeight = 0;
fts3GetVarint32(zBlob, &iNewHeight);
if( iNewHeight<=iHeight ){
if( iNewHeight>=iHeight ){
rc = FTS_CORRUPT_VTAB;
}else{
rc = fts3SelectLeaf(p, zTerm, nTerm, zBlob, nBlob, piLeaf, piLeaf2);

View File

@ -1379,7 +1379,7 @@ static int fts3SegReaderNext(
pNext += fts3GetVarint32(pNext, &nSuffix);
if( nSuffix<=0
|| (&pReader->aNode[pReader->nNode] - pNext)<nSuffix
|| nPrefix>pReader->nTermAlloc
|| nPrefix>pReader->nTerm
){
return FTS_CORRUPT_VTAB;
}