summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0404
blob: 351e3096e2fb7d40c4f1638c44819c7ed0605e9a (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0404
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.0404
Problem:    Accessing invalid memory with long argument name.
Solution:   Use item_count instead of checking for a terminating NULL.
            (Dominique Pelle, closes #3444)
Files:	    src/testdir/test_arglist.vim, src/version.c


*** ../vim-8.1.0403/src/testdir/test_arglist.vim	2018-08-31 23:06:18.735841246 +0200
--- src/testdir/test_arglist.vim	2018-09-18 21:48:47.705268287 +0200
***************
*** 411,413 ****
--- 411,420 ----
    call assert_equal('notexist Xx\ x runtest.vim', expand('##'))
    call delete('Xx x')
  endfunc
+ 
+ func Test_large_arg()
+   " Argument longer or equal to the number of columns used to cause
+   " access to invalid memory.
+   exe 'argadd ' .repeat('x', &columns)
+   args
+ endfunc
*** ../vim-8.1.0403/src/version.c	2018-09-18 21:41:43.716652306 +0200
--- src/version.c	2018-09-18 21:50:15.188571404 +0200
***************
*** 1725,1731 ****
      if (Columns < width)
      {
  	/* Not enough screen columns - show one per line */
! 	for (i = 0; items[i] != NULL; ++i)
  	{
  	    version_msg_wrap(items[i], i == current);
  	    if (msg_col > 0)
--- 1727,1733 ----
      if (Columns < width)
      {
  	/* Not enough screen columns - show one per line */
! 	for (i = 0; i < item_count; ++i)
  	{
  	    version_msg_wrap(items[i], i == current);
  	    if (msg_col > 0)
*** ../vim-8.1.0403/src/version.c	2018-09-18 21:41:43.716652306 +0200
--- src/version.c	2018-09-18 21:50:15.188571404 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     404,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
91. It's Saturday afternoon in the middle of May and you
    are on computer.

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