From 7995e7a89bfed790bd8ddc008f886993f17e1cce Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 10 Oct 2025 09:41:31 -0400 Subject: [PATCH] vim-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. https://github.com/vim/vim/commit/7b6903f02c9eeb12cd85941ea0d352d84e4dab30 Co-authored-by: Bram Moolenaar --- src/nvim/eval/userfunc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index 084d310035..51115b960b 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -281,7 +281,7 @@ static ufunc_T *alloc_ufunc(const char *name, size_t namelen) { size_t len = offsetof(ufunc_T, uf_name) + namelen + 1; ufunc_T *fp = xcalloc(1, len); - STRCPY(fp->uf_name, name); + xmemcpyz(fp->uf_name, name, namelen); fp->uf_namelen = namelen; if ((uint8_t)name[0] == K_SPECIAL) {