# HG changeset patch # User Bram Moolenaar # Date 1579025704 -3600 # Node ID 3856047f2211ca2c43d7ca2fa7b7c888a617ddfc # Parent 4858db71820396c7a8dcf4b2bee8012918b264f9 patch 8.2.0117: crash when using gettabwinvar() with invalid arguments Commit: https://github.com/vim/vim/commit/ee93b737aaa7bf65edc7281f429dd89fcf657a6f Author: Bram Moolenaar Date: Tue Jan 14 19:05:39 2020 +0100 patch 8.2.0117: crash when using gettabwinvar() with invalid arguments Problem: Crash when using gettabwinvar() with invalid arguments. (Yilin Yang) Solution: Use "curtab" if "tp" is NULL. (closes #5475) diff --git a/src/evalwindow.c b/src/evalwindow.c --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -183,7 +183,8 @@ find_win_by_nr( { #ifdef FEAT_PROP_POPUP // check tab-local popup windows - for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next) + for (wp = (tp == NULL ? curtab : tp)->tp_first_popupwin; + wp != NULL; wp = wp->w_next) if (wp->w_id == nr) return wp; // check global popup windows diff --git a/src/testdir/test_getvar.vim b/src/testdir/test_getvar.vim --- a/src/testdir/test_getvar.vim +++ b/src/testdir/test_getvar.vim @@ -83,6 +83,7 @@ func Test_var() unlet def_dict + call assert_equal("", gettabwinvar(9, 2020, '')) call assert_equal('', gettabwinvar(2, 3, '&nux')) call assert_equal(1, gettabwinvar(2, 3, '&nux', 1)) tabonly diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 117, +/**/ 116, /**/ 115,