From 804725a6b9ea8ba9ef507866b1d8d2628d1e4356 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 18 Nov 2019 14:04:21 +0000 Subject: [PATCH] Improvements to detection of corruption in the %_stat shadow table of FTS4. FossilOrigin-Name: 6b67eba54e7b4887a8cdab7537b12a95e9f17bcdaa0b423af5ed5bd91f69f2c6 --- ext/fts3/fts3.c | 13 +++++++------ ext/fts3/fts3_snippet.c | 5 +---- ext/fts3/fts3_tokenizer.c | 4 +++- manifest | 18 +++++++++--------- manifest.uuid | 2 +- test/fts3auto.test | 5 +++++ 6 files changed, 26 insertions(+), 21 deletions(-) diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index 4c6ff87718..9d580a2810 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -4895,12 +4895,13 @@ static int fts3EvalAverageDocsize(Fts3Cursor *pCsr, int *pnPage){ rc = sqlite3Fts3SelectDoctotal(p, &pStmt); if( rc!=SQLITE_OK ) return rc; a = sqlite3_column_blob(pStmt, 0); - assert( a ); - - pEnd = &a[sqlite3_column_bytes(pStmt, 0)]; - a += sqlite3Fts3GetVarint(a, &nDoc); - while( a