diff options
author | drh <> | 2021-04-03 23:30:33 +0000 |
---|---|---|
committer | drh <> | 2021-04-03 23:30:33 +0000 |
commit | 57f90189a551638129bcaf207814859baa4af5b2 (patch) | |
tree | c92cc04d0cb7c03afad32171e25f4841d980f0c6 /src/window.c | |
parent | ad3930be463ed013207e100e9050a7399da69d35 (diff) | |
download | sqlite-57f90189a551638129bcaf207814859baa4af5b2.tar.gz sqlite-57f90189a551638129bcaf207814859baa4af5b2.zip |
Improved robustness to OOM conditions in the window function logic.
dbsqlfuzz 0c123f7d80b29beaafc8411c12129e46f7ffdac3.
FossilOrigin-Name: 35ff7cbf547d41109b7cd4217a5439b3b4a1a4c310309c572c88f596fbc1b099
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c index 33e905e53..b19eb3395 100644 --- a/src/window.c +++ b/src/window.c @@ -897,9 +897,10 @@ static ExprList *exprListAppendList( int i; int nInit = pList ? pList->nExpr : 0; for(i=0; i<pAppend->nExpr; i++){ - Expr *pDup = sqlite3ExprDup(pParse->db, pAppend->a[i].pExpr, 0); + sqlite3 *db = pParse->db; + Expr *pDup = sqlite3ExprDup(db, pAppend->a[i].pExpr, 0); assert( pDup==0 || !ExprHasProperty(pDup, EP_MemToken) ); - if( bIntToNull && pDup ){ + if( bIntToNull && db->mallocFailed==0 ){ int iDummy; Expr *pSub; for(pSub=pDup; ExprHasProperty(pSub, EP_Skip); pSub=pSub->pLeft){ |