coverity/183543: Null pointer dereference #9836

Window may disappear, see e7e2115de5.
This commit is contained in:
Justin M. Keyes 2019-04-03 11:33:16 +02:00 committed by GitHub
parent d9de4c0efb
commit fb555c6898
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -982,6 +982,9 @@ static bool send_mouse_event(Terminal *term, int c)
{
int row = mouse_row, col = mouse_col, grid = mouse_grid;
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) {
// 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;
}
end:
ins_char_typebuf(c);
return true;
}