mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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)
This commit is contained in:
parent
c10b521628
commit
ee93b737aa
@ -183,7 +183,8 @@ find_win_by_nr(
|
|||||||
{
|
{
|
||||||
#ifdef FEAT_PROP_POPUP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// check tab-local popup windows
|
// 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)
|
if (wp->w_id == nr)
|
||||||
return wp;
|
return wp;
|
||||||
// check global popup windows
|
// check global popup windows
|
||||||
|
@ -83,6 +83,7 @@ func Test_var()
|
|||||||
|
|
||||||
unlet def_dict
|
unlet def_dict
|
||||||
|
|
||||||
|
call assert_equal("", gettabwinvar(9, 2020, ''))
|
||||||
call assert_equal('', gettabwinvar(2, 3, '&nux'))
|
call assert_equal('', gettabwinvar(2, 3, '&nux'))
|
||||||
call assert_equal(1, gettabwinvar(2, 3, '&nux', 1))
|
call assert_equal(1, gettabwinvar(2, 3, '&nux', 1))
|
||||||
tabonly
|
tabonly
|
||||||
|
@ -742,6 +742,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
117,
|
||||||
/**/
|
/**/
|
||||||
116,
|
116,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user