diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-04-24 19:52:01 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-02-28 18:21:08 +0800 |
commit | 4e25b1a675976ed238752d547dc05aaaef38af29 (patch) | |
tree | d4fe94242977ede190366d550c7791f21a0f1c92 /src | |
parent | 7c6a9c55890f77fc7b571de649c232d70db3a01a (diff) | |
download | rneovim-4e25b1a675976ed238752d547dc05aaaef38af29.tar.gz rneovim-4e25b1a675976ed238752d547dc05aaaef38af29.tar.bz2 rneovim-4e25b1a675976ed238752d547dc05aaaef38af29.zip |
vim-patch:8.2.4647: "source" can read past end of copied line
Problem: "source" can read past end of copied line.
Solution: Add a terminating NUL.
https://github.com/vim/vim/commit/2bdad6126778f907c0b98002bfebf0e611a3f5db
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/runtime.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index 209afcdc4a..85af98f9ce 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -2723,7 +2723,9 @@ static char *get_one_sourceline(source_cookie_T *sp) } ga_concat(&ga, ((char **)sp->buflines.ga_data)[sp->buf_lnum]); sp->buf_lnum++; + ga_grow(&ga, 1); buf = (char *)ga.ga_data; + buf[ga.ga_len++] = NUL; } else { buf = ga.ga_data; retry: |