summaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-04-11 16:56:35 +0200
committerBram Moolenaar <Bram@vim.org>2011-04-11 16:56:35 +0200
commitef9d6aa70d68cd3a765ed55f4c3781aeb8aeea23 (patch)
treee099b52d0ebf51c535ebe3cd875d8f70c06332df /src/menu.c
parent0d35e91abfa9e17f7c554bfd33b119b879448c72 (diff)
downloadvim-ef9d6aa70d68cd3a765ed55f4c3781aeb8aeea23.zip
updated for version 7.3.160
Problem: Unsafe string copying. Solution: Use vim_strncpy() instead of strcpy(). Use vim_strcat() instead of strcat().
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/menu.c b/src/menu.c
index 4d2bce18b..42cf67eb9 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1394,7 +1394,8 @@ get_menu_names(xp, idx)
int idx;
{
static vimmenu_T *menu = NULL;
- static char_u tbuffer[256]; /*hack*/
+#define TBUFFER_LEN 256
+ static char_u tbuffer[TBUFFER_LEN]; /*hack*/
char_u *str;
#ifdef FEAT_MULTI_LANG
static int should_advance = FALSE;
@@ -1428,11 +1429,11 @@ get_menu_names(xp, idx)
{
#ifdef FEAT_MULTI_LANG
if (should_advance)
- STRCPY(tbuffer, menu->en_dname);
+ vim_strncpy(tbuffer, menu->en_dname, TBUFFER_LEN - 2);
else
{
#endif
- STRCPY(tbuffer, menu->dname);
+ vim_strncpy(tbuffer, menu->dname, TBUFFER_LEN - 2);
#ifdef FEAT_MULTI_LANG
if (menu->en_dname == NULL)
should_advance = TRUE;