summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-31 21:40:33 +0100
committerBram Moolenaar <Bram@vim.org>2022-03-31 21:40:33 +0100
commit96e08e028cbcda23dccf83de6b71b3c6bf1f9d4a (patch)
treefbc716dcf37e97cd261d658282d48a5ab67335f2
parent3a6f952cc87065a4cf1f6502b2054ba99fdf45ed (diff)
downloadvim-git-96e08e028cbcda23dccf83de6b71b3c6bf1f9d4a.tar.gz
patch 8.2.4659: invalid memory access when using printable function namev8.2.4659
Problem: Invalid memory access when using printable function name. Solution: Adjust copied name length.
-rw-r--r--src/userfunc.c2
-rw-r--r--src/version.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index ffc67eab4..052923e94 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -543,7 +543,7 @@ make_ufunc_name_readable(char_u *name, char_u *buf, size_t bufsize)
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 f0240d244..c6f444696 100644
--- 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 */
/**/
+ 4659,
+/**/
4658,
/**/
4657,