mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 11:38:31 +00:00
Merge pull request #14027 from dylanarmstrong/fix/13955-empty-paste-in-term-segfault
fix: segfault when pasting in term with empty buffer
This commit is contained in:
@@ -580,6 +580,9 @@ static bool is_filter_char(int c)
|
|||||||
|
|
||||||
void terminal_paste(long count, char_u **y_array, size_t y_size)
|
void terminal_paste(long count, char_u **y_array, size_t y_size)
|
||||||
{
|
{
|
||||||
|
if (y_size == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
vterm_keyboard_start_paste(curbuf->terminal->vt);
|
vterm_keyboard_start_paste(curbuf->terminal->vt);
|
||||||
terminal_flush_output(curbuf->terminal);
|
terminal_flush_output(curbuf->terminal);
|
||||||
size_t buff_len = STRLEN(y_array[0]);
|
size_t buff_len = STRLEN(y_array[0]);
|
||||||
|
@@ -258,6 +258,13 @@ describe(':terminal buffer', function()
|
|||||||
it('handles wqall', function()
|
it('handles wqall', function()
|
||||||
eq('Vim(wqall):E948: Job still running', exc_exec('wqall'))
|
eq('Vim(wqall):E948: Job still running', exc_exec('wqall'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('does not segfault when pasting empty buffer #13955', function()
|
||||||
|
feed_command('terminal')
|
||||||
|
feed('<c-\\><c-n>')
|
||||||
|
feed_command('put a') -- buffer a is empty
|
||||||
|
helpers.assert_alive()
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('No heap-buffer-overflow when using', function()
|
describe('No heap-buffer-overflow when using', function()
|
||||||
|
Reference in New Issue
Block a user