From c6eb1f42bec06e92c2c5ee9a523af4e46ac05083 Mon Sep 17 00:00:00 2001 From: Abdelhakeem Osama Date: Thu, 22 Aug 2019 11:07:54 +0300 Subject: API: fix nvim_command_output buffer overflow (#10830) Fixes https://github.com/neovim/neovim/issues/10829. --- test/functional/api/vim_spec.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/functional/api/vim_spec.lua') diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 519b65081e..cd45914552 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -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() -- cgit