changeset 28267:39a833e69bf3 v8.2.4659

patch 8.2.4659: invalid memory access when using printable function name Commit: https://github.com/vim/vim/commit/96e08e028cbcda23dccf83de6b71b3c6bf1f9d4a Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 31 21:40:33 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Mar 2022 22:45:03 +0200
parents 0b12ce9ae38f
children ec433fec31a6
files src/userfunc.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -543,7 +543,7 @@ make_ufunc_name_readable(char_u *name, c
     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;
 }
--- 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,