diff options
author | drh <drh@noemail.net> | 2005-05-19 01:26:14 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2005-05-19 01:26:14 +0000 |
commit | dd9f8b45ef63de1bdcdb462d9477e2bfe54a394f (patch) | |
tree | 6730957731dd32a95c9857e7a21d3aec0854a8f2 /src | |
parent | 8e855770deccb7a6634adaddab26e2857f19e57f (diff) | |
download | sqlite-dd9f8b45ef63de1bdcdb462d9477e2bfe54a394f.tar.gz sqlite-dd9f8b45ef63de1bdcdb462d9477e2bfe54a394f.zip |
Fix an array index that is out of bounds. Ticket #1251. (CVS 2462)
FossilOrigin-Name: bcf87e4d1681d6c2856e716aae0135c2b14989d8
Diffstat (limited to 'src')
-rw-r--r-- | src/where.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/where.c b/src/where.c index 48ad161a7..3987d17ae 100644 --- a/src/where.c +++ b/src/where.c @@ -16,7 +16,7 @@ ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** -** $Id: where.c,v 1.137 2005/04/22 02:38:38 drh Exp $ +** $Id: where.c,v 1.138 2005/05/19 01:26:14 drh Exp $ */ #include "sqliteInt.h" @@ -793,7 +793,7 @@ WhereInfo *sqlite3WhereBegin( && (pTerm->prereqRight & loopMask)==pTerm->prereqRight ){ int iColumn = pX->pLeft->iColumn; int k; - char idxaff = pIdx->pTable->aCol[iColumn].affinity; + char idxaff = iColumn>=0 ? pIdx->pTable->aCol[iColumn].affinity : 0; for(k=0; k<pIdx->nColumn; k++){ /* If the collating sequences or affinities don't match, ** ignore this index. */ |