]> granicus.if.org Git - vim/commitdiff
patch 8.2.2026: Coverity warns for possibly using not NUL terminated string v8.2.2026
authorBram Moolenaar <Bram@vim.org>
Sat, 21 Nov 2020 12:51:16 +0000 (13:51 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 21 Nov 2020 12:51:16 +0000 (13:51 +0100)
Problem:    Coverity warns for possibly using not NUL terminated string.
Solution:   Put a NUL in b0_hname just in case.

src/memline.c
src/version.c

index bf6a18499c8c4a9d6e8cac9e1fca5ab3dfebea4f..19b87d7ee9451ccfa668e4a64d09b587c5bef9c7 100644 (file)
@@ -2252,6 +2252,7 @@ swapfile_unchanged(char_u *fname)
 
        mch_get_host_name(hostname, B0_HNAME_SIZE);
        hostname[B0_HNAME_SIZE - 1] = NUL;
+       b0.b0_hname[B0_HNAME_SIZE - 1] = NUL; // in case of corruption
        if (STRICMP(b0.b0_hname, hostname) != 0)
            ret = FALSE;
     }
index d7e1fee6e6bcd5d7433af8b362c9efaa9816e1f9..80253553ef1469a59d97d04c54f3f34adba8d46b 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2026,
 /**/
     2025,
 /**/