]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4473: Coverity warnds for not checking return value of ftell() v8.2.4473
authorBram Moolenaar <Bram@vim.org>
Fri, 25 Feb 2022 21:47:48 +0000 (21:47 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 25 Feb 2022 21:47:48 +0000 (21:47 +0000)
Problem:    Coverity warnds for not checking return value of ftell().
Solution:   Bail out if ftell() returns a negative value.

src/spellfile.c
src/version.c

index 370e80b8155dedb4ae979e446112b883301bb11d..ad0d0002113ade9053673541093f1fed49f9cc3e 100644 (file)
@@ -6256,6 +6256,8 @@ spell_add_word(
            {
                fpos = fpos_next;
                fpos_next = ftell(fd);
+               if (fpos_next < 0)
+                   break;  // should never happen
                if (STRNCMP(word, line, len) == 0
                        && (line[len] == '/' || line[len] < ' '))
                {
index e0384c8ef0d9708f858b73b3aa554ea394c12f3b..7b5d66a84e4afbc1b2b3f465dc909986dad15376 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4473,
 /**/
     4472,
 /**/