changeset 22959:4cce4a5d3fd3 v8.2.2026

patch 8.2.2026: Coverity warns for possibly using not NUL terminated string Commit: https://github.com/vim/vim/commit/e79cdb69a4905ccf766494265d4c6f8701d10c39 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 21 13:51:16 2020 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Sat, 21 Nov 2020 14:00:03 +0100
parents e7c125224b1a
children 0fe441f6d90b
files src/memline.c src/version.c
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/memline.c
+++ b/src/memline.c
@@ -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;
     }
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2026,
+/**/
     2025,
 /**/
     2024,