Permalink
Browse files

patch 8.0.1409: buffer overflow in :tags command

Problem:    Buffer overflow in :tags command.
Solution:   Use vim_snprintf(). (Dominique Pelle, closes #2471, closes #2475)
            Add a test.
  • Loading branch information...
brammool committed Dec 19, 2017
1 parent a0ca7d0 commit 132f75255ecea17ff621f71236568c5d8d8e0163
Showing with 9 additions and 2 deletions.
  1. +1 −1 src/tag.c
  2. +6 −1 src/testdir/test_taglist.vim
  3. +2 −0 src/version.c
View
@@ -1130,7 +1130,7 @@ do_tags(exarg_T *eap UNUSED)
continue;
msg_putchar('\n');
sprintf((char *)IObuff, "%c%2d %2d %-15s %5ld ",
vim_snprintf((char *)IObuff, IOSIZE, "%c%2d %2d %-15s %5ld ",
i == tagstackidx ? '>' : ' ',
i + 1,
tagstack[i].cur_match + 1,
@@ -1,4 +1,4 @@
" test 'taglist' function
" test 'taglist' function and :tags command
func Test_taglist()
call writefile([
@@ -56,3 +56,8 @@ func Test_taglist_ctags_etags()
call delete('Xtags')
endfunc
func Test_tags_too_long()
call assert_fails('tag ' . repeat('x', 1020), 'E426')
tags
endfunc
View
@@ -771,6 +771,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1409,
/**/
1408,
/**/

0 comments on commit 132f752

Please sign in to comment.