]> granicus.if.org Git - vim/commitdiff
patch 8.2.3328: Coverity error for not checking return value v8.2.3328
authorBram Moolenaar <Bram@vim.org>
Wed, 11 Aug 2021 13:54:59 +0000 (15:54 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 11 Aug 2021 13:54:59 +0000 (15:54 +0200)
Problem:    Coverity error for not checking return value.
Solution:   Check value is not negative.

src/spellfile.c
src/version.c

index 058558eb3226e4707957bd8e5efa14fe0c1b2371..0d7b194aa5ff27c728f2e4986b5f2ac0369ac988 100644 (file)
@@ -1258,13 +1258,15 @@ read_compound(FILE *fd, slang_T *slang, int len)
 
        gap = &slang->sl_comppat;
        c = get2c(fd);                                  // <comppatcount>
+       if (c < 0)
+           return SP_TRUNCERROR;
        todo -= 2;
        ga_init2(gap, sizeof(char_u *), c);
        if (ga_grow(gap, c) == OK)
            while (--c >= 0)
            {
                ((char_u **)(gap->ga_data))[gap->ga_len++] =
-                                                read_cnt_string(fd, 1, &cnt);
+                                                 read_cnt_string(fd, 1, &cnt);
                                            // <comppatlen> <comppattext>
                if (cnt < 0)
                    return cnt;
index 12a78a81136f8694ada30b3b6c5415637d4f0f71..4041be41a32e123fb356874b704c3ffc4749d15c 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3328,
 /**/
     3327,
 /**/