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 <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/drawscreen.c b/src/drawscreen.c
index 36034cc..a08cea3 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -479,7 +479,10 @@
|| 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 5a47806..c360a24 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1021,
+/**/
1020,
/**/
1019,