]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1021: string might be used without a trailing NUL v9.1.1021
authorJohn Marriott <basilisk@internode.on.net>
Thu, 16 Jan 2025 17:58:20 +0000 (18:58 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 16 Jan 2025 17:58:20 +0000 (18:58 +0100)
Problem:  string might be used without a trailing NUL (after v9.1.0997)
Solution: Make sure that the buffer is NUL terminated

closes: #16457

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/drawscreen.c
src/version.c

index 36034cc9dfc86b19092cad5c3eb8e50f2666ef17..a08cea3d61d2476d4c0fc9abfa81070ae1c6cb17 100644 (file)
@@ -479,7 +479,10 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
                    || bufIsChanged(wp->w_buffer)
                    || wp->w_buffer->b_p_ro)
                && plen < MAXPATHL - 1)
-           *(p + plen++) = ' ';
+       {
+           *(p + plen++) = ' ';        // replace NUL with space
+           *(p + plen) = NUL;          // NUL terminate the string
+       }
        if (bt_help(wp->w_buffer))
            plen += vim_snprintf((char *)p + plen, MAXPATHL - plen, "%s", _("[Help]"));
 #ifdef FEAT_QUICKFIX
index 5a47806a5229c153c86f812e80f2974c89dd7e82..c360a2416be8eafa5ff77552dc39cf85a4a200dd 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1021,
 /**/
     1020,
 /**/