diff options
author | drh <drh@noemail.net> | 2019-11-16 11:33:39 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-11-16 11:33:39 +0000 |
commit | 47bcc34271435e376b57a8482e06803f4a7a6c4f (patch) | |
tree | 8af1bd893c7532dee5554ce61776f290b82223fe /src | |
parent | 5710f1ad4822394087defa0cfefec9129fa8e885 (diff) | |
download | sqlite-47bcc34271435e376b57a8482e06803f4a7a6c4f.tar.gz sqlite-47bcc34271435e376b57a8482e06803f4a7a6c4f.zip |
Fix a potential NULL pointer dereference on a RENAME TABLE that references
a VIEW with a logic error in a window function in the ORDER BY clause.
FossilOrigin-Name: 0adb273f7e7671efb0e0a1619887e369500dfd2db7ef1b1e125c2414ea96e96f
Diffstat (limited to 'src')
-rw-r--r-- | src/window.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c index fb806a506..ccd19024f 100644 --- a/src/window.c +++ b/src/window.c @@ -1244,8 +1244,8 @@ void sqlite3WindowAttach(Parse *pParse, Expr *p, Window *pWin){ ** SELECT, or (b) the windows already linked use a compatible window frame. */ void sqlite3WindowLink(Select *pSel, Window *pWin){ - if( 0==pSel->pWin - || 0==sqlite3WindowCompare(0, pSel->pWin, pWin, 0) + if( pSel!=0 + && (0==pSel->pWin || 0==sqlite3WindowCompare(0, pSel->pWin, pWin, 0)) ){ pWin->pNextWin = pSel->pWin; if( pSel->pWin ){ |