mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
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.
e79cdb69a4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1548,6 +1548,7 @@ static bool swapfile_unchanged(char *fname)
|
||||
char hostname[B0_HNAME_SIZE];
|
||||
os_get_hostname(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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user