mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 19:25:11 -07:00
vim-patch:8.1.0404: accessing invalid memory with long argument name
Problem: Accessing invalid memory with long argument name.
Solution: Use item_count instead of checking for a terminating NULL.
(Dominique Pelle, closes vim/vim#3444)
e961cba3cb
This commit is contained in:
parent
8a9c9a9963
commit
cbda383efe
@ -452,3 +452,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
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user