# HG changeset patch # User Bram Moolenaar # Date 1648759503 -7200 # Node ID 39a833e69bf36a5101fb9f6b8357a0f3e9c9bf7e # Parent 0b12ce9ae38fecf22c1f4705efdb8f7b122af2bf patch 8.2.4659: invalid memory access when using printable function name Commit: https://github.com/vim/vim/commit/96e08e028cbcda23dccf83de6b71b3c6bf1f9d4a Author: Bram Moolenaar 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. diff --git a/src/userfunc.c b/src/userfunc.c --- 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, "", 5); return buf; } diff --git a/src/version.c b/src/version.c --- 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,