1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix a buffer overread that might occur in analyze.c if SQLITE_ENABLE_STAT4 was defined.

FossilOrigin-Name: c1ae1268b9023a771fda98f26bf451c6066fe70b
This commit is contained in:
dan
2014-12-05 21:04:26 +00:00
parent 2928d32791
commit 5cca94ea71
3 changed files with 9 additions and 8 deletions

View File

@@ -1596,7 +1596,7 @@ static void initAvgEq(Index *pIdx){
i64 nSum100 = 0; /* Number of terms contributing to sumEq */
i64 nDist100; /* Number of distinct values in index */
if( pIdx->aiRowEst==0 || pIdx->aiRowEst[iCol+1]==0 ){
if( !pIdx->aiRowEst || iCol>=pIdx->nKeyCol || pIdx->aiRowEst[iCol+1]==0 ){
nRow = pFinal->anLt[iCol];
nDist100 = (i64)100 * pFinal->anDLt[iCol];
nSample--;