]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.1046: the "secure" variable is used inconsistently v8.1.1046
authorBram Moolenaar <Bram@vim.org>
Sun, 24 Mar 2019 13:02:04 +0000 (14:02 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 24 Mar 2019 13:02:04 +0000 (14:02 +0100)
Problem:    the "secure" variable is used inconsistently. (Justin M. Keyes)
Solution:   Set it to one instead of incrementing.

src/buffer.c
src/option.c
src/version.c

index 158c30a5a1688a06675c8a4ece961a81c5a3eb35..6cfa41fab6b67354a1c6fb224f61896b8482e11e 100644 (file)
@@ -5498,7 +5498,7 @@ chk_modeline(
                current_sctx.sc_lnum = 0;
 #endif
                // Make sure no risky things are executed as a side effect.
-               ++secure;
+               secure = 1;
 
                retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
 
index f9cbcbd7b89ab78f07dd8ad267aa22d6e96e8a1f..8149521fc104a9e848819c7cc7547f4eab43fa8b 100644 (file)
@@ -5151,13 +5151,12 @@ do_set(
                            // effects in secure mode.  Also when the value was
                            // set with the P_INSECURE flag and is not
                            // completely replaced.
-                           if (secure
+                           if ((opt_flags & OPT_MODELINE)
 #ifdef HAVE_SANDBOX
-                                   || sandbox != 0
+                                 || sandbox != 0
 #endif
-                                   || (opt_flags & OPT_MODELINE)
-                                   || (!value_is_replaced && (*p & P_INSECURE)))
-                               ++secure;
+                                 || (!value_is_replaced && (*p & P_INSECURE)))
+                               secure = 1;
 
                            // Handle side effects, and set the global value
                            // for ":set" on local options. Note: when setting
index 133fd3e5722e2237ae996476b8b164504abf363d..3a195e5c49d83650d2547b27a72c1e37adf61d54 100644 (file)
@@ -775,6 +775,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1046,
 /**/
     1045,
 /**/