Mercurial > vim
comparison src/testdir/test_taglist.vim @ 13068:63fdea6e9c6c v8.0.1409
patch 8.0.1409: buffer overflow in :tags command
commit https://github.com/vim/vim/commit/132f75255ecea17ff621f71236568c5d8d8e0163
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 19 10:49:34 2017 +0100
patch 8.0.1409: buffer overflow in :tags command
Problem: Buffer overflow in :tags command.
Solution: Use vim_snprintf(). (Dominique Pelle, closes https://github.com/vim/vim/issues/2471, closes https://github.com/vim/vim/issues/2475)
Add a test.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Dec 2017 11:00:06 +0100 |
parents | c7ba89661c39 |
children | 4afe2386aae8 |
comparison
equal
deleted
inserted
replaced
13067:90405f52088a | 13068:63fdea6e9c6c |
---|---|
1 " test 'taglist' function | 1 " test 'taglist' function and :tags command |
2 | 2 |
3 func Test_taglist() | 3 func Test_taglist() |
4 call writefile([ | 4 call writefile([ |
5 \ "FFoo\tXfoo\t1", | 5 \ "FFoo\tXfoo\t1", |
6 \ "FBar\tXfoo\t2", | 6 \ "FBar\tXfoo\t2", |
54 call assert_equal([['set_signals', '1335,32699'], ['reset_signals', '1407,34136']], | 54 call assert_equal([['set_signals', '1335,32699'], ['reset_signals', '1407,34136']], |
55 \ map(taglist('set_signals'), {i, v -> [v.name, v.cmd]})) | 55 \ map(taglist('set_signals'), {i, v -> [v.name, v.cmd]})) |
56 | 56 |
57 call delete('Xtags') | 57 call delete('Xtags') |
58 endfunc | 58 endfunc |
59 | |
60 func Test_tags_too_long() | |
61 call assert_fails('tag ' . repeat('x', 1020), 'E426') | |
62 tags | |
63 endfunc |