Commit 8ea5f27
patch 9.2.0266: typeahead buffer overflow during mouse drag event
Problem: typeahead buffer overflow during mouse drag event
Solution: Change the guard from 5 to 10 to account for the worst case
(Yasuhiro Matsumoto).
The typeahead buffer guard in mch_inchar() only reserved 5 bytes per
iteration, but a mouse event writes up to 7 bytes (3 header + 4
coordinates) and a scroll event with modifiers writes up to 10 bytes
(3 modifier + 3 scroll + 4 coordinates). During fast mouse dragging,
3+ events could queue up and overflow the 20-byte buffer, corrupting
adjacent static variables and causing garbage bytes (including Ctrl-Z)
to be fed into the input stream, which triggered nv_suspend/ex_stop.
closes: #19851
Signed-off-by: Yasuhiro Matsumoto <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>1 parent f896627 commit 8ea5f27
2 files changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2424 | 2424 | | |
2425 | 2425 | | |
2426 | 2426 | | |
2427 | | - | |
2428 | | - | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
2429 | 2430 | | |
2430 | | - | |
| 2431 | + | |
2431 | 2432 | | |
2432 | 2433 | | |
2433 | 2434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
| 737 | + | |
| 738 | + | |
737 | 739 | | |
738 | 740 | | |
739 | 741 | | |
| |||
0 commit comments