aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-10-09 15:37:58 +0000
committerdrh <drh@noemail.net>2019-10-09 15:37:58 +0000
commit92a2824cc61df5683337d61b5a9d190935039326 (patch)
tree8d6ef7d92f377418870701c44f535264d61d2097 /src/expr.c
parenta6bd1871d1c0c63df9a0482b07477380eb55200d (diff)
downloadsqlite-92a2824cc61df5683337d61b5a9d190935039326.tar.gz
sqlite-92a2824cc61df5683337d61b5a9d190935039326.zip
An improved fix for the dbsqlfuzz-discovered ALWAYS() failure following OOM in
sqlite3ExprCollSeq(). This time with a test case (engineered by Dan). FossilOrigin-Name: 907f7965b335d8d5441f2e386bb190d1f93ffcd45ca98d2d1c621dede491fc5e
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/expr.c b/src/expr.c
index 3e73c9208..fd6b57128 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -186,7 +186,10 @@ CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
/* p->flags holds EP_Collate and p->pLeft->flags does not. And
** p->x.pSelect cannot. So if p->x.pLeft exists, it must hold at
** least one EP_Collate. Thus the following two ALWAYS. */
- if( p->x.pList!=0 && ALWAYS(!ExprHasProperty(p, EP_xIsSelect)) ){
+ if( p->x.pList!=0
+ && !db->mallocFailed
+ && ALWAYS(!ExprHasProperty(p, EP_xIsSelect))
+ ){
int i;
for(i=0; ALWAYS(i<p->x.pList->nExpr); i++){
if( ExprHasProperty(p->x.pList->a[i].pExpr, EP_Collate) ){
@@ -1530,10 +1533,6 @@ Select *sqlite3SelectDup(sqlite3 *db, Select *pDup, int flags){
pNext = pNew;
}
- if( db->mallocFailed ){
- sqlite3SelectDelete(db, pRet);
- pRet = 0;
- }
return pRet;
}
#else