diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-19 11:06:35 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-19 11:06:35 +0000 |
commit | 2de5371a755abd287dab6ff544924715a76d4abe (patch) | |
tree | a1162f966cf3aa2188a862bcebef924689e4cb83 /src/eval.c | |
parent | 389b72196e6aaeafe3f907c73d271f2c6b931140 (diff) |
patch 8.2.3850: illegal memory access when displaying a partialv8.2.3850
Problem: Illegal memory access when displaying a partial.
Solution: Terminate the string with a NUL. (closes #9371)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index ecc242dcdd..d0ad7c6e89 100644 --- a/src/eval.c +++ b/src/eval.c @@ -5087,7 +5087,8 @@ echo_string_core( ga_concat(&ga, tv2string(&dtv, &tf, numbuf, copyID)); vim_free(tf); } - ga_concat(&ga, (char_u *)")"); + // terminate with ')' and a NUL + ga_concat_len(&ga, (char_u *)")", 2); *tofree = ga.ga_data; r = *tofree; |