1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Improved detection of corruption in the %_stat table of FTS4.

Chromium ticket 1025467.

FossilOrigin-Name: 10f8a3b718e0f47be528fba086c318e1dfe18ead383d01cfa24dedabad41e0a2
This commit is contained in:
drh
2019-11-18 10:37:57 +00:00
parent ac801803a5
commit 19d4175d65
4 changed files with 20 additions and 11 deletions

View File

@ -1065,10 +1065,10 @@ static int fts3MatchinfoSelectDoctotal(
}
pEnd = a + n;
a += sqlite3Fts3GetVarintBounded(a, pEnd, &nDoc);
if( nDoc==0 || a>pEnd ){
if( nDoc<=0 || a>pEnd ){
return FTS_CORRUPT_VTAB;
}
*pnDoc = (u32)nDoc;
*pnDoc = nDoc;
if( paLen ) *paLen = a;
if( ppEnd ) *ppEnd = pEnd;