vim-patch:9.1.1021: string might be used without a trailing NUL (#32062)

Problem:  string might be used without a trailing NUL (after v9.1.0997)
Solution: Make sure that the buffer is NUL terminated

closes: vim/vim#16457

70dfc374ec

Co-authored-by: John Marriott <basilisk@internode.on.net>
This commit is contained in:
zeertzjq
2025-01-17 08:53:10 +08:00
committed by GitHub
parent 0d3a8e8c1a
commit cd92924896

View File

@@ -103,7 +103,8 @@ void win_redr_status(win_T *wp)
|| 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 += snprintf(p + plen, MAXPATHL - (size_t)plen, "%s", _("[Help]"));