summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0068
blob: 21c51359dafd0a2946cc36cbafcd2ff839bc9c95 (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0068
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.0068
Problem:    Nasty autocommands can still cause using freed memory.
Solution:   Disallow using setloclist() and setqflist() recursively.
Files:	    src/evalfunc.c


*** ../vim-8.1.0067/src/evalfunc.c	2018-06-12 20:25:47.887923393 +0200
--- src/evalfunc.c	2018-06-17 19:16:21.949606435 +0200
***************
*** 10621,10626 ****
--- 10652,10658 ----
      static char *e_invact = N_("E927: Invalid action: '%s'");
      char_u	*act;
      int		action = 0;
+     static int	recursive = 0;
  #endif
  
      rettv->vval.v_number = -1;
***************
*** 10628,10633 ****
--- 10660,10667 ----
  #ifdef FEAT_QUICKFIX
      if (list_arg->v_type != VAR_LIST)
  	EMSG(_(e_listreq));
+     else if (recursive != 0)
+ 	EMSG(_(e_au_recursive));
      else
      {
  	list_T  *l = list_arg->vval.v_list;
***************
*** 10662,10670 ****
  	    }
  	}
  
  	if (l != NULL && action && valid_dict && set_errorlist(wp, l, action,
! 	  (char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"), d) == OK)
  	    rettv->vval.v_number = 0;
      }
  #endif
  }
--- 10696,10707 ----
  	    }
  	}
  
+ 	++recursive;
  	if (l != NULL && action && valid_dict && set_errorlist(wp, l, action,
! 		     (char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"),
! 		     d) == OK)
  	    rettv->vval.v_number = 0;
+ 	--recursive;
      }
  #endif
  }
*** ../vim-8.1.0067/src/version.c	2018-06-17 19:08:26.476323920 +0200
--- src/version.c	2018-06-17 19:17:27.305233384 +0200
***************
*** 763,764 ****
--- 763,766 ----
  {   /* Add new patch number below this line */
+ /**/
+     68,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
63. You start using smileys in your snail mail.

 /// 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    ///