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)
f56c95fdad
This commit is contained in:
Jan Edmund Lazo
2020-07-21 18:51:47 -04:00
parent ed41ac08cf
commit 9443d39941
2 changed files with 32 additions and 1 deletions

View File

@@ -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;
}
}
}
}