aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2018-12-12 11:23:40 +0000
committerdrh <drh@noemail.net>2018-12-12 11:23:40 +0000
commit03c5c213289baed1f809d3e58dee1e2abfb72f2b (patch)
tree2e1bb7a1eb501be5498369effe145393d6ed48a0 /src/expr.c
parentcfc078318cc39ab2f98369a1be8fdc221ea63851 (diff)
downloadsqlite-03c5c213289baed1f809d3e58dee1e2abfb72f2b.tar.gz
sqlite-03c5c213289baed1f809d3e58dee1e2abfb72f2b.zip
OSSFuzz found a case where an assert() inside sqlite3ExprCompare() can be
true. Test case added to TH3. FossilOrigin-Name: 23b62fb160d86dc9d9073bcc714601f5b7695f96abd893eafecf4b2e565b87f2
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index 0b2e79775..dc6f0332c 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -4784,8 +4784,10 @@ int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTab){
&& sqlite3ExprCompare(pParse, pA->pLeft, pB->pLeft, iTab) ) return 2;
if( sqlite3ExprCompare(pParse, pA->pRight, pB->pRight, iTab) ) return 2;
if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2;
- assert( (combinedFlags & EP_Reduced)==0 );
- if( pA->op!=TK_STRING && pA->op!=TK_TRUEFALSE ){
+ if( pA->op!=TK_STRING
+ && pA->op!=TK_TRUEFALSE
+ && (combinedFlags & EP_Reduced)==0
+ ){
if( pA->iColumn!=pB->iColumn ) return 2;
if( pA->iTable!=pB->iTable
&& (pA->iTable!=iTab || NEVER(pB->iTable>=0)) ) return 2;