1
0
forked from aniani/vim

patch 8.2.2026: Coverity warns for possibly using not NUL terminated string

Problem:    Coverity warns for possibly using not NUL terminated string.
Solution:   Put a NUL in b0_hname just in case.
This commit is contained in:
Bram Moolenaar
2020-11-21 13:51:16 +01:00
parent 4466ad6baa
commit e79cdb69a4
2 changed files with 3 additions and 0 deletions

View 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;
}

View File

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