Skip to content

Commit 925ccfd

Browse files
committed
patch 7.4.1680
Problem: Coverity warns for not checking name length (false positive). Solution: Only copy the characters we know are there.
1 parent 7d2a579 commit 925ccfd

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/channel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,11 +2284,11 @@ channel_status(channel_T *channel)
22842284
channel_part_info(channel_T *channel, dict_T *dict, char *name, int part)
22852285
{
22862286
chanpart_T *chanpart = &channel->ch_part[part];
2287-
char namebuf[20];
2287+
char namebuf[20]; /* longest is "sock_timeout" */
22882288
size_t tail;
22892289
char *s = "";
22902290

2291-
STRCPY(namebuf, name);
2291+
vim_strncpy((char_u *)namebuf, (char_u *)name, 4);
22922292
STRCAT(namebuf, "_");
22932293
tail = STRLEN(namebuf);
22942294

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1680,
751753
/**/
752754
1679,
753755
/**/

0 commit comments

Comments
 (0)