mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.2414: using freed memory when closing the cmdline window
Problem: Using freed memory when closing the cmdline window. Solution: Check the window is still valid.
This commit is contained in:
@@ -4395,9 +4395,14 @@ open_cmdwin(void)
|
|||||||
// Avoid command-line window first character being concealed.
|
// Avoid command-line window first character being concealed.
|
||||||
curwin->w_p_cole = 0;
|
curwin->w_p_cole = 0;
|
||||||
# endif
|
# endif
|
||||||
|
// First go back to the original window.
|
||||||
wp = curwin;
|
wp = curwin;
|
||||||
set_bufref(&bufref, curbuf);
|
set_bufref(&bufref, curbuf);
|
||||||
win_goto(old_curwin);
|
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(wp, TRUE);
|
||||||
|
|
||||||
// win_close() may have already wiped the buffer when 'bh' is
|
// win_close() may have already wiped the buffer when 'bh' is
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2414,
|
||||||
/**/
|
/**/
|
||||||
2413,
|
2413,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user