0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 8.1.0613: when executing an insecure function the secure flag is stuck

Problem:    When executing an insecure function the secure flag is stuck.
            (Gabriel Barta)
Solution:   Restore "secure" instead of decrementing it. (closes #3705)
This commit is contained in:
Bram Moolenaar
2018-12-21 13:03:28 +01:00
parent 9d302ad4e3
commit 48f377a476
4 changed files with 34 additions and 12 deletions

View File

@@ -5214,7 +5214,7 @@ do_set(
{
long_u *p = insecure_flag(opt_idx, opt_flags);
int did_inc_secure = FALSE;
int secure_saved = secure;
// When an option is set in the sandbox, from a
// modeline or in secure mode, then deal with side
@@ -5227,21 +5227,18 @@ do_set(
#endif
|| (opt_flags & OPT_MODELINE)
|| (!value_is_replaced && (*p & P_INSECURE)))
{
did_inc_secure = TRUE;
++secure;
}
// Handle side effects, and set the global value for
// ":set" on local options. Note: when setting 'syntax'
// or 'filetype' autocommands may be triggered that can
// cause havoc.
errmsg = did_set_string_option(opt_idx, (char_u **)varp,
// Handle side effects, and set the global value
// for ":set" on local options. Note: when setting
// 'syntax' or 'filetype' autocommands may be
// triggered that can cause havoc.
errmsg = did_set_string_option(
opt_idx, (char_u **)varp,
new_value_alloced, oldval, errbuf,
opt_flags, &value_checked);
if (did_inc_secure)
--secure;
secure = secure_saved;
}
#if defined(FEAT_EVAL)