1
0
forked from aniani/vim

patch 7.4.936

Problem:    Crash when dragging with the mouse.
Solution:   Add safety check for NULL pointer. Check mouse position for valid
            value. (Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2015-11-22 19:39:38 +01:00
parent 6040256d8b
commit 294a7e55b0
3 changed files with 11 additions and 0 deletions

View File

@@ -5231,6 +5231,13 @@ check_termcode(max_offset, buf, bufsize, buflen)
else
key_name[1] = get_pseudo_mouse_code(current_button,
is_click, is_drag);
/* Make sure the mouse position is valid. Some terminals may
* return weird values. */
if (mouse_col >= Columns)
mouse_col = Columns - 1;
if (mouse_row >= Rows)
mouse_row = Rows - 1;
}
#endif /* FEAT_MOUSE */