mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.3902: Vim9: double free with nested :def function
Problem: Vim9: double free with nested :def function. Solution: Pass "line_to_free" from compile_def_function() and make sure cmdlinep is valid.
This commit is contained in:
@@ -3345,10 +3345,12 @@ exec_instructions(ectx_T *ectx)
|
||||
else
|
||||
{
|
||||
exarg_T ea;
|
||||
char_u *line_to_free = NULL;
|
||||
|
||||
CLEAR_FIELD(ea);
|
||||
ea.cmd = ea.arg = iptr->isn_arg.string;
|
||||
define_function(&ea, NULL);
|
||||
define_function(&ea, NULL, &line_to_free);
|
||||
vim_free(line_to_free);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user