From 9443d3994190943c2b9d8c4efefcf3de854ec7be Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 21 Jul 2020 18:51:47 -0400 Subject: vim-patch:8.2.1259: empty group in 'tabline' may cause using an invalid pointer Problem: Empty group in 'tabline' may cause using an invalid pointer. Solution: Set the group start position. (closes vim/vim#6505) https://github.com/vim/vim/commit/f56c95fdad5af521887f8cd7bc15729b5355231d --- src/nvim/buffer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 86067aceac..b3bbdce9d9 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3646,13 +3646,19 @@ int build_stl_str_hl( } } if (n == curitem && group_start_userhl == group_end_userhl) { + // empty group out_p = t; group_len = 0; - // do not use the highlighting from the removed group for (n = groupitems[groupdepth] + 1; n < curitem; n++) { + // do not use the highlighting from the removed group if (items[n].type == Highlight) { items[n].type = Empty; } + // adjust the start position of TabPage to the next + // item position + if (items[n].type == TabPage) { + items[n].start = out_p; + } } } } -- cgit