Patch 8.2.2414

6 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 26, 2021, 4:01:30 PM1/26/21
to vim...@googlegroups.com

Patch 8.2.2414
Problem: Using freed memory when closing the cmdline window.
Solution: Check the window is still valid.
Files: src/ex_getln.c


*** ../vim-8.2.2413/src/ex_getln.c 2021-01-26 21:35:05.048158026 +0100
--- src/ex_getln.c 2021-01-26 21:59:15.218347244 +0100
***************
*** 4395,4404 ****
// Avoid command-line window first character being concealed.
curwin->w_p_cole = 0;
# endif
wp = curwin;
set_bufref(&bufref, curbuf);
win_goto(old_curwin);
! win_close(wp, TRUE);

// win_close() may have already wiped the buffer when 'bh' is
// set to 'wipe'
--- 4395,4409 ----
// Avoid command-line window first character being concealed.
curwin->w_p_cole = 0;
# endif
+ // First go back to the original window.
wp = curwin;
set_bufref(&bufref, curbuf);
win_goto(old_curwin);
!
! // win_goto() may trigger an autocommand that already closes the
! // cmdline window.
! if (win_valid(wp))
! win_close(wp, TRUE);

// win_close() may have already wiped the buffer when 'bh' is
// set to 'wipe'
*** ../vim-8.2.2413/src/version.c 2021-01-26 21:35:05.052158016 +0100
--- src/version.c 2021-01-26 22:00:31.618184606 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2414,
/**/

--
If you're sending someone Styrofoam, what do you pack it in?

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