mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
coverity/183543: Null pointer dereference #9836
Window may disappear, see e7e2115de5
.
This commit is contained in:
@@ -982,6 +982,9 @@ static bool send_mouse_event(Terminal *term, int c)
|
|||||||
{
|
{
|
||||||
int row = mouse_row, col = mouse_col, grid = mouse_grid;
|
int row = mouse_row, col = mouse_col, grid = mouse_grid;
|
||||||
win_T *mouse_win = mouse_find_win(&grid, &row, &col);
|
win_T *mouse_win = mouse_find_win(&grid, &row, &col);
|
||||||
|
if (mouse_win == NULL) {
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (term->forward_mouse && mouse_win->w_buffer->terminal == term) {
|
if (term->forward_mouse && mouse_win->w_buffer->terminal == term) {
|
||||||
// event in the terminal window and mouse events was enabled by the
|
// event in the terminal window and mouse events was enabled by the
|
||||||
@@ -1029,6 +1032,7 @@ static bool send_mouse_event(Terminal *term, int c)
|
|||||||
return mouse_win == curwin;
|
return mouse_win == curwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
ins_char_typebuf(c);
|
ins_char_typebuf(c);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user