mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
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.
2bdad61267
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user