0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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.
This commit is contained in:
Bram Moolenaar
2022-03-31 21:40:33 +01:00
parent 3a6f952cc8
commit 96e08e028c
2 changed files with 3 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4659,
/**/
4658,
/**/