mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 22:08:18 +00:00
vim-patch:7.4.936 #4271
Problem: Crash when dragging with the mouse.
Solution: Add safety check for NULL pointer. Check mouse position for valid
value. (Hirohito Higashi)
294a7e55b0
---
see: "Crash while mouse-selecting in two-buffer mode"
https://github.com/vim/vim/issues/486
Fix #3704
This commit is contained in:
@@ -4575,10 +4575,19 @@ void win_drag_vsep_line(win_T *dragwin, int offset)
|
||||
}
|
||||
assert(fr);
|
||||
|
||||
if (room < offset) /* Not enough room */
|
||||
offset = room; /* Move as far as we can */
|
||||
if (offset <= 0) /* No room at all, quit. */
|
||||
// Not enough room
|
||||
if (room < offset) {
|
||||
offset = room; // Move as far as we can
|
||||
}
|
||||
|
||||
// No room at all, quit.
|
||||
if (offset <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fr == NULL) {
|
||||
return; // Safety check, should not happen.
|
||||
}
|
||||
|
||||
/* grow frame fr by offset lines */
|
||||
frame_new_width(fr, fr->fr_width + offset, left, FALSE);
|
||||
|
Reference in New Issue
Block a user