0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3923: Vim9: double free with split argument list in nested function

Problem:    Vim9: double free if a nested function has a line break in the
            argument list.
Solution:   Set cmdlinep when freeing the previous line.
This commit is contained in:
Bram Moolenaar
2021-12-28 17:23:12 +00:00
parent 8bb3fe4d4d
commit 4bf1006cae
3 changed files with 23 additions and 1 deletions

View File

@@ -219,6 +219,8 @@ get_function_args(
if (theline == NULL)
break;
vim_free(*line_to_free);
if (*eap->cmdlinep == *line_to_free)
*eap->cmdlinep = theline;
*line_to_free = theline;
whitep = (char_u *)" ";
p = skipwhite(theline);