Problem: Buffer overflow in :tags command.
Solution: Use vim_snprintf(). (Dominique Pelle, closes #2471, closes #2475)
Add a test.
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,
-" test 'taglist' function
+" test 'taglist' function and :tags command
func Test_taglist()
call writefile([
call delete('Xtags')
endfunc
+
+func Test_tags_too_long()
+ call assert_fails('tag ' . repeat('x', 1020), 'E426')
+ tags
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1409,
/**/
1408,
/**/