0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.0422: crash when passing popup window to win_splitmove()

Problem:    Crash when passing popup window to win_splitmove(). (john Devin)
Solution:   Disallow moving a popup window. (closes #5816)
This commit is contained in:
Bram Moolenaar
2020-03-20 21:15:51 +01:00
parent 9645e2d9fc
commit 0f1563ffee
3 changed files with 16 additions and 1 deletions

View File

@@ -810,7 +810,8 @@ f_win_splitmove(typval_T *argvars, typval_T *rettv)
targetwin = find_win_by_nr_or_id(&argvars[1]);
if (wp == NULL || targetwin == NULL || wp == targetwin
|| !win_valid(wp) || !win_valid(targetwin))
|| !win_valid(wp) || !win_valid(targetwin)
|| win_valid_popup(wp) || win_valid_popup(targetwin))
{
emsg(_(e_invalwindow));
rettv->vval.v_number = -1;

View File

@@ -3307,4 +3307,16 @@ func Test_popupwin_atcursor_far_right()
set signcolumn&
endfunc
func Test_popupwin_splitmove()
vsplit
let win2 = win_getid()
let popup_winid = popup_dialog('hello', {})
call assert_fails('call win_splitmove(popup_winid, win2)', 'E957:')
call assert_fails('call win_splitmove(win2, popup_winid)', 'E957:')
call popup_clear()
bwipe
endfunc
" vim: shiftwidth=2 sts=2

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
422,
/**/
421,
/**/