0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.0.0970: passing invalid highlight id

Problem:    if there is no StatusLine highlighting and there is StatusLineNC
            or StatusLineTermNC highlighting then an invalid highlight id is
            passed to combine_stl_hlt(). (Coverity)
Solution:   Check id_S to be -1 instead of zero.
This commit is contained in:
Bram Moolenaar
2017-08-19 21:35:35 +02:00
parent dc926dd0dd
commit d6a7b3e6bb
2 changed files with 3 additions and 1 deletions

View File

@@ -9999,7 +9999,7 @@ highlight_changed(void)
if (ga_grow(&highlight_ga, 28) == FAIL) if (ga_grow(&highlight_ga, 28) == FAIL)
return FAIL; return FAIL;
hlcnt = highlight_ga.ga_len; hlcnt = highlight_ga.ga_len;
if (id_S == 0) if (id_S == -1)
{ {
/* Make sure id_S is always valid to simplify code below. Use the last /* Make sure id_S is always valid to simplify code below. Use the last
* entry. */ * entry. */

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
970,
/**/ /**/
969, 969,
/**/ /**/