vim-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 vim/vim#3705)
48f377a476
This commit is contained in:
Jan Edmund Lazo
2019-05-05 11:23:25 -04:00
parent 0673b0d251
commit 9c6476d81e
3 changed files with 33 additions and 12 deletions

View File

@@ -5112,6 +5112,7 @@ chk_modeline(
*e = NUL; // truncate the set command
if (*s != NUL) { // skip over an empty "::"
const int secure_save = secure;
save_SID = current_SID;
current_SID = SID_MODELINE;
// Make sure no risky things are executed as a side effect.
@@ -5119,7 +5120,7 @@ chk_modeline(
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
secure--;
secure = secure_save;
current_SID = save_SID;
if (retval == FAIL) { // stop if error found
break;