1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-22 20:22:44 +03:00

Fix a buffer overrun in the where.c. Problem detected by valgrind.

FossilOrigin-Name: 15bb62330681a5b2aad95a1d1fc9ab8f6f1bd6b9
This commit is contained in:
drh
2010-07-03 01:44:27 +00:00
parent fd28639f12
commit 0eb77d0568
3 changed files with 19 additions and 9 deletions

View File

@@ -3435,7 +3435,7 @@ static Bitmask codeOneLoopStart(
** a forward order scan on a descending index, interchange the
** start and end terms (pRangeStart and pRangeEnd).
*/
if( bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC) ){
if( nEq<pIdx->nColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC) ){
SWAP(WhereTerm *, pRangeEnd, pRangeStart);
}