mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
fix(context): don't crash on invalid arg to nvim_get_context (#25977)
Note: The crash happens in the second test case when using uninitialized memory, and therefore doesn't happen with ASAN.
This commit is contained in:
@@ -375,6 +375,12 @@ describe('context functions', function()
|
||||
eq(outofbounds, pcall_err(call, 'ctxset', {dummy = 1}, 0))
|
||||
end)
|
||||
|
||||
it('errors when context dictionary is invalid', function()
|
||||
call('ctxpush')
|
||||
eq('Vim:E474: Failed to convert list to msgpack string buffer',
|
||||
pcall_err(call, 'ctxset', { regs = { {} } }))
|
||||
end)
|
||||
|
||||
it('sets context dictionary at index in context stack', function()
|
||||
nvim('set_var', 'one', 1)
|
||||
nvim('set_var', 'Two', 2)
|
||||
|
Reference in New Issue
Block a user