1
0
forked from aniani/vim

updated for version 7.3.160

Problem:    Unsafe string copying.
Solution:   Use vim_strncpy() instead of strcpy().  Use vim_strcat() instead
            of strcat().
This commit is contained in:
Bram Moolenaar
2011-04-11 16:56:35 +02:00
parent 0d35e91abf
commit ef9d6aa70d
13 changed files with 63 additions and 32 deletions

View File

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