vim-patch:9.0.0821: crash with win_move_statusline() in another tabpage (#20894)

vim-patch:86e6717ace4f

Problem:    Crash when using win_move_statusline() in another tab page.
Solution:   Check for valid window pointer. (issue vim/vim#11427)

86e6717ace

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2022-11-01 07:29:55 +08:00
committed by GitHub
parent 428ab6f24e
commit d8dbf58b43
2 changed files with 16 additions and 0 deletions

View File

@@ -112,6 +112,8 @@ PRAGMA_DIAG_POP
static char *e_listblobarg = N_("E899: Argument of %s must be a List or Blob");
static char *e_invalwindow = N_("E957: Invalid window number");
static char *e_reduceempty = N_("E998: Reduce of an empty %s with no initial value");
static char e_cannot_resize_window_in_another_tab_page[]
= N_("E1308: Cannot resize a window in another tab page");
/// Dummy va_list for passing to vim_snprintf
///
@@ -9694,6 +9696,10 @@ static void f_win_move_statusline(typval_T *argvars, typval_T *rettv, EvalFuncDa
if (wp == NULL || wp->w_floating) {
return;
}
if (!win_valid(wp)) {
emsg(_(e_cannot_resize_window_in_another_tab_page));
return;
}
offset = (int)tv_get_number(&argvars[1]);
win_drag_status_line(wp, offset);