commit 7995e7a89bfed790bd8ddc008f886993f17e1cce
parent eb67f3a6ba52fd35edc8940a6e780a14bac75518
Author: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
Date: Fri, 10 Oct 2025 09:41:31 -0400
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 <Bram@vim.org>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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) {