mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.1.0068: nasty autocommands can still cause using freed memory
Problem: Nasty autocommands can still cause using freed memory. Solution: Disallow using setloclist() and setqflist() recursively.
This commit is contained in:
@@ -10621,6 +10621,7 @@ set_qf_ll_list(
|
|||||||
static char *e_invact = N_("E927: Invalid action: '%s'");
|
static char *e_invact = N_("E927: Invalid action: '%s'");
|
||||||
char_u *act;
|
char_u *act;
|
||||||
int action = 0;
|
int action = 0;
|
||||||
|
static int recursive = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rettv->vval.v_number = -1;
|
rettv->vval.v_number = -1;
|
||||||
@@ -10628,6 +10629,8 @@ set_qf_ll_list(
|
|||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
if (list_arg->v_type != VAR_LIST)
|
if (list_arg->v_type != VAR_LIST)
|
||||||
EMSG(_(e_listreq));
|
EMSG(_(e_listreq));
|
||||||
|
else if (recursive != 0)
|
||||||
|
EMSG(_(e_au_recursive));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
list_T *l = list_arg->vval.v_list;
|
list_T *l = list_arg->vval.v_list;
|
||||||
@@ -10662,9 +10665,12 @@ set_qf_ll_list(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
++recursive;
|
||||||
if (l != NULL && action && valid_dict && set_errorlist(wp, l, action,
|
if (l != NULL && action && valid_dict && set_errorlist(wp, l, action,
|
||||||
(char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"), d) == OK)
|
(char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"),
|
||||||
|
d) == OK)
|
||||||
rettv->vval.v_number = 0;
|
rettv->vval.v_number = 0;
|
||||||
|
--recursive;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -761,6 +761,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 */
|
||||||
|
/**/
|
||||||
|
68,
|
||||||
/**/
|
/**/
|
||||||
67,
|
67,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user