mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
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:
@@ -5231,6 +5231,13 @@ check_termcode(max_offset, buf, bufsize, buflen)
|
|||||||
else
|
else
|
||||||
key_name[1] = get_pseudo_mouse_code(current_button,
|
key_name[1] = get_pseudo_mouse_code(current_button,
|
||||||
is_click, is_drag);
|
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 */
|
#endif /* FEAT_MOUSE */
|
||||||
|
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
936,
|
||||||
/**/
|
/**/
|
||||||
935,
|
935,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -5785,6 +5785,8 @@ win_drag_vsep_line(dragwin, offset)
|
|||||||
offset = room; /* Move as far as we can */
|
offset = room; /* Move as far as we can */
|
||||||
if (offset <= 0) /* No room at all, quit. */
|
if (offset <= 0) /* No room at all, quit. */
|
||||||
return;
|
return;
|
||||||
|
if (fr == NULL)
|
||||||
|
return; /* Safety check, should not happen. */
|
||||||
|
|
||||||
/* grow frame fr by offset lines */
|
/* grow frame fr by offset lines */
|
||||||
frame_new_width(fr, fr->fr_width + offset, left, FALSE);
|
frame_new_width(fr, fr->fr_width + offset, left, FALSE);
|
||||||
|
Reference in New Issue
Block a user