patch 9.1.1021: string might be used without a trailing NUL

Commit: 
https://github.com/vim/vim/commit/70dfc374ec72634a0a61aea8344178779675d516
Author: John Marriott <basil...@internode.on.net>
Date:   Thu Jan 16 18:58:20 2025 +0100

    patch 9.1.1021: string might be used without a trailing NUL
    
    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 <basil...@internode.on.net>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/drawscreen.c b/src/drawscreen.c
index 36034cc9d..a08cea3d6 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -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
diff --git a/src/version.c b/src/version.c
index 5a47806a5..c360a2416 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1021,
 /**/
     1020,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1tYUOW-00GO1V-4n%40256bit.org.

Raspunde prin e-mail lui