patch 8.2.4659: invalid memory access when using printable function name
Problem: Invalid memory access when using printable function name.
Solution: Adjust copied name length.
diff --git a/src/userfunc.c b/src/userfunc.c
index ffc67ea..052923e 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -543,7 +543,7 @@
if (len + 3 > bufsize)
return name;
- mch_memmove(buf + 5, name + 3, len + 1);
+ mch_memmove(buf + 5, name + 3, len - 2); // Include trailing NUL
mch_memmove(buf, "<SNR>", 5);
return buf;
}
diff --git a/src/version.c b/src/version.c
index f0240d2..c6f4446 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4659,
+/**/
4658,
/**/
4657,