summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1046
blob: 85a705659cd7f262b5aaf054f61f0d9709e34e44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1046
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.1046
Problem:    the "secure" variable is used inconsistently. (Justin M. Keyes)
Solution:   Set it to one instead of incrementing.
Files:	    src/buffer.c, src/option.c


*** ../vim-8.1.1045/src/buffer.c	2019-03-02 10:13:36.788974890 +0100
--- src/buffer.c	2019-03-24 13:48:30.222662964 +0100
***************
*** 5498,5504 ****
  		current_sctx.sc_lnum = 0;
  #endif
  		// Make sure no risky things are executed as a side effect.
! 		++secure;
  
  		retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
  
--- 5498,5504 ----
  		current_sctx.sc_lnum = 0;
  #endif
  		// Make sure no risky things are executed as a side effect.
! 		secure = 1;
  
  		retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
  
*** ../vim-8.1.1045/src/option.c	2019-03-21 21:45:30.879282125 +0100
--- src/option.c	2019-03-24 13:50:57.149725126 +0100
***************
*** 5151,5163 ****
  			    // effects in secure mode.  Also when the value was
  			    // set with the P_INSECURE flag and is not
  			    // completely replaced.
! 			    if (secure
  #ifdef HAVE_SANDBOX
! 				    || sandbox != 0
  #endif
! 				    || (opt_flags & OPT_MODELINE)
! 				    || (!value_is_replaced && (*p & P_INSECURE)))
! 				++secure;
  
  			    // Handle side effects, and set the global value
  			    // for ":set" on local options. Note: when setting
--- 5151,5162 ----
  			    // effects in secure mode.  Also when the value was
  			    // set with the P_INSECURE flag and is not
  			    // completely replaced.
! 			    if ((opt_flags & OPT_MODELINE)
  #ifdef HAVE_SANDBOX
! 				  || sandbox != 0
  #endif
! 				  || (!value_is_replaced && (*p & P_INSECURE)))
! 				secure = 1;
  
  			    // Handle side effects, and set the global value
  			    // for ":set" on local options. Note: when setting
*** ../vim-8.1.1045/src/version.c	2019-03-23 17:41:56.217138373 +0100
--- src/version.c	2019-03-24 13:53:30.596743493 +0100
***************
*** 777,778 ****
--- 777,780 ----
  {   /* Add new patch number below this line */
+ /**/
+     1046,
  /**/

-- 
In a world without walls and borders, who needs windows and gates?

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///