Patch 8.2.3927

6 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 28, 2021, 3:19:20 PM12/28/21
to vim...@googlegroups.com

Patch 8.2.3927
Problem: Vim9: double free when using lambda.
Solution: Don't free both cmdline and line_to_free.
Files: src/userfunc.c


*** ../vim-8.2.3926/src/userfunc.c 2021-12-28 17:55:22.963786520 +0000
--- src/userfunc.c 2021-12-28 20:13:32.463720698 +0000
***************
*** 1146,1152 ****
ga_init2(&newlines, (int)sizeof(char_u *), 10);
if (get_function_body(&eap, &newlines, NULL, &line_to_free) == FAIL)
{
! vim_free(cmdline);
goto erret;
}

--- 1146,1153 ----
ga_init2(&newlines, (int)sizeof(char_u *), 10);
if (get_function_body(&eap, &newlines, NULL, &line_to_free) == FAIL)
{
! if (cmdline != line_to_free)
! vim_free(cmdline);
goto erret;
}

*** ../vim-8.2.3926/src/version.c 2021-12-28 20:03:38.980797969 +0000
--- src/version.c 2021-12-28 20:18:34.763023710 +0000
***************
*** 751,752 ****
--- 751,754 ----
{ /* Add new patch number below this line */
+ /**/
+ 3927,
/**/

--
In a world without fences, who needs Gates and Windows?

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages