0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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.
This commit is contained in:
Bram Moolenaar
2017-12-19 10:49:34 +01:00
parent a0ca7d002d
commit 132f75255e
3 changed files with 9 additions and 2 deletions

View File

@@ -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,