changeset 23829:950875545045 v8.2.2456

patch 8.2.2456: Coverity warning for strcpy() into fixed size array Commit: https://github.com/vim/vim/commit/7b6903f02c9eeb12cd85941ea0d352d84e4dab30 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 3 19:31:29 2021 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Feb 2021 19:45:04 +0100
parents 628f15e44a31
children 6e5a62752f93
files src/userfunc.c src/version.c
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -403,7 +403,9 @@ register_closure(ufunc_T *fp)
     static void
 set_ufunc_name(ufunc_T *fp, char_u *name)
 {
-    STRCPY(fp->uf_name, name);
+    // Add a type cast to avoid a warning for an overflow, the uf_name[] array
+    // actually extends beyond the struct.
+    STRCPY((void *)fp->uf_name, name);
 
     if (name[0] == K_SPECIAL)
     {
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2456,
+/**/
     2455,
 /**/
     2454,