aboutsummaryrefslogtreecommitdiff
path: root/src/whereexpr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-01-10 15:08:06 +0000
committerdrh <drh@noemail.net>2017-01-10 15:08:06 +0000
commitd9bcb32ebb4b94df6c241bc09080cd0832d3a01b (patch)
tree3c6bfa4b36ba212565bfe2d29c448707e3dda104 /src/whereexpr.c
parente4a8b8769e38fa62bfbada282b4a07cc8aea4ece (diff)
downloadsqlite-d9bcb32ebb4b94df6c241bc09080cd0832d3a01b.tar.gz
sqlite-d9bcb32ebb4b94df6c241bc09080cd0832d3a01b.zip
Fix a potential assertion fault discovered by OSS-Fuzz.
FossilOrigin-Name: 71c03b59b645884ebd6b9e18713cd2eb8c949870
Diffstat (limited to 'src/whereexpr.c')
-rw-r--r--src/whereexpr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/whereexpr.c b/src/whereexpr.c
index 4bb161044..27c6ebc2f 100644
--- a/src/whereexpr.c
+++ b/src/whereexpr.c
@@ -913,6 +913,7 @@ static void exprAnalyze(
Parse *pParse = pWInfo->pParse; /* Parsing context */
sqlite3 *db = pParse->db; /* Database connection */
unsigned char eOp2; /* op2 value for LIKE/REGEXP/GLOB */
+ int nLeft; /* Number of elements on left side vector */
if( db->mallocFailed ){
return;
@@ -1184,13 +1185,12 @@ static void exprAnalyze(
** is not a sub-select. */
if( pWC->op==TK_AND
&& (pExpr->op==TK_EQ || pExpr->op==TK_IS)
- && sqlite3ExprIsVector(pExpr->pLeft)
+ && (nLeft = sqlite3ExprVectorSize(pExpr->pLeft))>1
+ && sqlite3ExprVectorSize(pExpr->pRight)==nLeft
&& ( (pExpr->pLeft->flags & EP_xIsSelect)==0
- || (pExpr->pRight->flags & EP_xIsSelect)==0
- )){
- int nLeft = sqlite3ExprVectorSize(pExpr->pLeft);
+ || (pExpr->pRight->flags & EP_xIsSelect)==0)
+ ){
int i;
- assert( nLeft==sqlite3ExprVectorSize(pExpr->pRight) );
for(i=0; i<nLeft; i++){
int idxNew;
Expr *pNew;