]> granicus.if.org Git - vim/commitdiff
patch 8.0.0970: passing invalid highlight id v8.0.0970
authorBram Moolenaar <Bram@vim.org>
Sat, 19 Aug 2017 19:35:35 +0000 (21:35 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 19 Aug 2017 19:35:35 +0000 (21:35 +0200)
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.

src/syntax.c
src/version.c

index 637a45012c41492b5835a014126ff46524425666..730357520221e351729808d8786da91915a224ae 100644 (file)
@@ -9999,7 +9999,7 @@ highlight_changed(void)
     if (ga_grow(&highlight_ga, 28) == FAIL)
        return FAIL;
     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
         * entry. */
index c1260ec870a58b573cc294380e90405376eee905..d820595b5064c46f8e442cab8c35bd66e8ac2831 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    970,
 /**/
     969,
 /**/