Skip to content

Commit 7b6903f

Browse files
committed
patch 8.2.2456: Coverity warning for strcpy() into fixed size array
Problem: Coverity warning for strcpy() into fixed size array. Solution: Add a type cast to hopefully silence the bogus warning.
1 parent 2e5910b commit 7b6903f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/userfunc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,9 @@ register_closure(ufunc_T *fp)
403403
static void
404404
set_ufunc_name(ufunc_T *fp, char_u *name)
405405
{
406-
STRCPY(fp->uf_name, name);
406+
// Add a type cast to avoid a warning for an overflow, the uf_name[] array
407+
// actually extends beyond the struct.
408+
STRCPY((void *)fp->uf_name, name);
407409

408410
if (name[0] == K_SPECIAL)
409411
{

src/version.c

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

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2456,
753755
/**/
754756
2455,
755757
/**/

0 commit comments

Comments
 (0)