API: fix nvim_command_output buffer overflow (#10830)

Fixes https://github.com/neovim/neovim/issues/10829.
This commit is contained in:
Abdelhakeem Osama
2019-08-22 11:07:54 +03:00
committed by Daniel Hahler
parent ed28668392
commit c6eb1f42be
2 changed files with 6 additions and 1 deletions

View File

@@ -178,6 +178,11 @@ describe('API', function()
-- Verify NO hit-enter prompt.
eq({mode='n', blocking=false}, nvim("get_mode"))
end)
it('Does not cause heap buffer overflow with large output', function()
eq(eval('string(range(1000000))'),
nvim('command_output', 'echo range(1000000)'))
end)
end)
describe('nvim_eval', function()