From: drh Date: Mon, 18 Nov 2019 14:04:21 +0000 (+0000) Subject: Improvements to detection of corruption in the %_stat shadow table of FTS4. X-Git-Tag: version-3.31.0~308 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=804725a6b9ea8ba9ef507866b1d8d2628d1e4356;p=thirdparty%2Fsqlite.git Improvements to detection of corruption in the %_stat shadow table of FTS4. FossilOrigin-Name: 6b67eba54e7b4887a8cdab7537b12a95e9f17bcdaa0b423af5ed5bd91f69f2c6 --- 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