1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Improvements to detection of corruption in the %_stat shadow table of FTS4.

FossilOrigin-Name: 6b67eba54e7b4887a8cdab7537b12a95e9f17bcdaa0b423af5ed5bd91f69f2c6
This commit is contained in:
drh
2019-11-18 14:04:21 +00:00
parent 13a8f203d9
commit 804725a6b9
6 changed files with 26 additions and 21 deletions

View File

@ -1056,12 +1056,9 @@ static int fts3MatchinfoSelectDoctotal(
assert( sqlite3_data_count(pStmt)==1 );
n = sqlite3_column_bytes(pStmt, 0);
if( n==0 ){
return FTS_CORRUPT_VTAB;
}
a = sqlite3_column_blob(pStmt, 0);
if( a==0 ){
return SQLITE_NOMEM;
return FTS_CORRUPT_VTAB;
}
pEnd = a + n;
a += sqlite3Fts3GetVarintBounded(a, pEnd, &nDoc);