mirror of
https://github.com/neovim/neovim.git
synced 2026-04-19 22:10:45 +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:
@@ -1979,6 +1979,13 @@ describe('API', function()
|
||||
nvim('load_context', ctx)
|
||||
eq({1, 2 ,3}, eval('[g:one, g:Two, g:THREE]'))
|
||||
end)
|
||||
|
||||
it('errors when context dictionary is invalid', function()
|
||||
eq('E474: Failed to convert list to msgpack string buffer',
|
||||
pcall_err(nvim, 'load_context', { regs = { {} } }))
|
||||
eq("Empty dictionary keys aren't allowed",
|
||||
pcall_err(nvim, 'load_context', { regs = { { [''] = '' } } }))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('nvim_replace_termcodes', function()
|
||||
|
||||
Reference in New Issue
Block a user