diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-07-27 01:33:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-27 01:33:58 +0200 |
commit | af01b347d8de8abbaaf8b7c86b41328316b646d3 (patch) | |
tree | 306b558278fbb35d43cf1810f69d9dcafc5df58d | |
parent | e1a5c29b93be8386a67c5e8f861b89178dff6867 (diff) | |
parent | 0fb05b2c7de757f7722c4e8133fea4f5fd359a6e (diff) | |
download | rneovim-af01b347d8de8abbaaf8b7c86b41328316b646d3.tar.gz rneovim-af01b347d8de8abbaaf8b7c86b41328316b646d3.tar.bz2 rneovim-af01b347d8de8abbaaf8b7c86b41328316b646d3.zip |
Merge #10606 'vim-patch:8.1.0404'
-rw-r--r-- | src/nvim/testdir/test_arglist.vim | 8 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim index 3efef60f8e..db5d3558fe 100644 --- a/src/nvim/testdir/test_arglist.vim +++ b/src/nvim/testdir/test_arglist.vim @@ -74,7 +74,6 @@ func Test_argadd() call assert_equal(1, len(argv())) call assert_equal('some file', get(argv(), 0, '')) - call delete('Xargadd') %argd new arga @@ -452,3 +451,10 @@ func Test_arg_all_expand() 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 diff --git a/src/nvim/version.c b/src/nvim/version.c index 28bd22dcb3..baa0df84f4 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -2063,7 +2063,7 @@ void list_in_columns(char_u **items, int size, int current) if (Columns < width) { // Not enough screen columns - show one per line - for (i = 0; items[i] != NULL; i++) { + for (i = 0; i < item_count; i++) { version_msg_wrap(items[i], i == current); if (msg_col > 0) { msg_putchar('\n'); |