aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-24 09:29:28 +0800
committerGitHub <noreply@github.com>2022-07-24 09:29:28 +0800
commitea13dce3bf126690876428bd99f4427fadc8358a (patch)
tree8efaab393ffbecb4250708b68cef8f35fa77261e
parent1849cf0e4c4376445ff05b9f7f5604b22ac915ff (diff)
downloadrneovim-ea13dce3bf126690876428bd99f4427fadc8358a.tar.gz
rneovim-ea13dce3bf126690876428bd99f4427fadc8358a.tar.bz2
rneovim-ea13dce3bf126690876428bd99f4427fadc8358a.zip
fix(mouse): fix using uninitialized memory with K_MOUSEMOVE (#19480)
Fix a mistake in the porting of Vim patch 8.0.1309.
-rw-r--r--src/nvim/keycodes.c2
-rw-r--r--test/functional/ui/mouse_spec.lua6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/keycodes.c b/src/nvim/keycodes.c
index 063e6f45f8..5a5257efb2 100644
--- a/src/nvim/keycodes.c
+++ b/src/nvim/keycodes.c
@@ -365,7 +365,7 @@ static struct mousetable {
{ (int)KE_X2DRAG, MOUSE_X2, false, true },
{ (int)KE_X2RELEASE, MOUSE_X2, false, false },
// DRAG without CLICK
- { (int)K_MOUSEMOVE, MOUSE_RELEASE, false, true },
+ { (int)KE_MOUSEMOVE, MOUSE_RELEASE, false, true },
// RELEASE without CLICK
{ (int)KE_IGNORE, MOUSE_RELEASE, false, false },
{ 0, 0, 0, 0 },
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index 69b0d1ecec..7305bd589b 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -1590,4 +1590,10 @@ describe('ui/mouse/input', function()
eq(0, meths.get_var('mouse_up3'))
eq(0, meths.get_var('mouse_up4'))
end)
+
+ it('feeding <MouseMove> does not use uninitialized memory #19480', function()
+ feed('<MouseMove>')
+ helpers.poke_eventloop()
+ helpers.assert_alive()
+ end)
end)