diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-17 18:21:53 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-17 18:24:31 +0800 |
commit | 8cf38c2fd9408f7de9d9ff1e4db6fc90aba554cf (patch) | |
tree | 614a40195e63bebaffd56ce10b97806d87b96a2a | |
parent | 1b95eaf84bdc5189b435fe98b365b5f120d99c2d (diff) | |
download | rneovim-8cf38c2fd9408f7de9d9ff1e4db6fc90aba554cf.tar.gz rneovim-8cf38c2fd9408f7de9d9ff1e4db6fc90aba554cf.tar.bz2 rneovim-8cf38c2fd9408f7de9d9ff1e4db6fc90aba554cf.zip |
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.
https://github.com/vim/vim/commit/e79cdb69a4905ccf766494265d4c6f8701d10c39
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | src/nvim/memline.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 8b5aef3be1..02a7e1f697 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -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; } |