diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-03 11:33:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 11:33:16 +0200 |
commit | fb555c6898e8deddf6191144b18b382fa8decf99 (patch) | |
tree | 40afa02521ba5f0ef54f4c8a6d5dad71ffe50494 | |
parent | d9de4c0efb142e140bbddd87ffcb0bf222bb6fbc (diff) | |
download | rneovim-fb555c6898e8deddf6191144b18b382fa8decf99.tar.gz rneovim-fb555c6898e8deddf6191144b18b382fa8decf99.tar.bz2 rneovim-fb555c6898e8deddf6191144b18b382fa8decf99.zip |
coverity/183543: Null pointer dereference #9836
Window may disappear, see e7e2115de5c1.
-rw-r--r-- | src/nvim/terminal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 4ef37f14d2..43beb684da 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -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; } |