Avoid an assert() failure and an undefined left-shift operation in the fts3 snippet() function that could occur if the database was corrupt.

FossilOrigin-Name: d5250db6322103326f0d5782ba049996d9ce8784f9e53a3112fb6f09f888f1c3
This commit is contained in:
dan
2019-02-28 13:41:35 +00:00
parent 45616c7f75
commit 95fdb63b7f
4 changed files with 230 additions and 10 deletions
+1 -1
View File
@@ -429,7 +429,7 @@ static void fts3SnippetDetails(
char *pCsr = pPhrase->pTail;
int iCsr = pPhrase->iTail;
while( iCsr<(iStart+pIter->nSnippet) ){
while( iCsr<(iStart+pIter->nSnippet) && iCsr>=iStart ){
int j;
u64 mPhrase = (u64)1 << i;
u64 mPos = (u64)1 << (iCsr - iStart);