mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.1.1649: Illegal memory access when closing popup window
Problem: Illegal memory access when closing popup window. Solution: Get w_next before closing the window.
This commit is contained in:
@@ -1437,6 +1437,7 @@ check_mouse_moved(win_T *wp, win_T *mouse_wp)
|
|||||||
|
|
||||||
res.v_type = VAR_NUMBER;
|
res.v_type = VAR_NUMBER;
|
||||||
res.vval.v_number = -2;
|
res.vval.v_number = -2;
|
||||||
|
// Careful: this makes "wp" invalid.
|
||||||
popup_close_and_callback(wp, &res);
|
popup_close_and_callback(wp, &res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1447,7 +1448,7 @@ check_mouse_moved(win_T *wp, win_T *mouse_wp)
|
|||||||
void
|
void
|
||||||
popup_handle_mouse_moved(void)
|
popup_handle_mouse_moved(void)
|
||||||
{
|
{
|
||||||
win_T *wp;
|
win_T *wp, *nextwp;
|
||||||
win_T *mouse_wp;
|
win_T *mouse_wp;
|
||||||
int row = mouse_row;
|
int row = mouse_row;
|
||||||
int col = mouse_col;
|
int col = mouse_col;
|
||||||
@@ -1455,11 +1456,17 @@ popup_handle_mouse_moved(void)
|
|||||||
// find the window where the mouse is in
|
// find the window where the mouse is in
|
||||||
mouse_wp = mouse_find_win(&row, &col, FIND_POPUP);
|
mouse_wp = mouse_find_win(&row, &col, FIND_POPUP);
|
||||||
|
|
||||||
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
for (wp = first_popupwin; wp != NULL; wp = nextwp)
|
||||||
|
{
|
||||||
|
nextwp = wp->w_next;
|
||||||
check_mouse_moved(wp, mouse_wp);
|
check_mouse_moved(wp, mouse_wp);
|
||||||
for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
}
|
||||||
|
for (wp = curtab->tp_first_popupwin; wp != NULL; wp = nextwp)
|
||||||
|
{
|
||||||
|
nextwp = wp->w_next;
|
||||||
check_mouse_moved(wp, mouse_wp);
|
check_mouse_moved(wp, mouse_wp);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In a filter: check if the typed key is a mouse event that is used for
|
* In a filter: check if the typed key is a mouse event that is used for
|
||||||
|
@@ -777,6 +777,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 */
|
||||||
|
/**/
|
||||||
|
1649,
|
||||||
/**/
|
/**/
|
||||||
1648,
|
1648,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user