aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-03-07 19:08:27 +0000
committerdrh <drh@noemail.net>2016-03-07 19:08:27 +0000
commit237b2b7111b4d8df3417b6a4aa77546609ada1db (patch)
tree40d22bab17526f2ea4e8989808ccee889624fece /src/wherecode.c
parent8c71a98ce13ce3169e6533dd05fce3c2cac2926a (diff)
downloadsqlite-237b2b7111b4d8df3417b6a4aa77546609ada1db.tar.gz
sqlite-237b2b7111b4d8df3417b6a4aa77546609ada1db.zip
Avoid a NULL pointer dereference following an OOM while generating code
for IN operators on virtual tables. FossilOrigin-Name: c924008692e35f1f5144830af08d6de051dd21dd
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index bfc52fb47..1f5a324ec 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -932,8 +932,10 @@ Bitmask sqlite3WhereCodeOneLoopStart(
if( pCompare ){
pCompare->pLeft = pTerm->pExpr->pLeft;
pCompare->pRight = pRight = sqlite3Expr(db, TK_REGISTER, 0);
- if( pRight ) pRight->iTable = iReg+j+2;
- sqlite3ExprIfFalse(pParse, pCompare, pLevel->addrCont, 0);
+ if( pRight ){
+ pRight->iTable = iReg+j+2;
+ sqlite3ExprIfFalse(pParse, pCompare, pLevel->addrCont, 0);
+ }
pCompare->pLeft = 0;
sqlite3ExprDelete(db, pCompare);
}