mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	vim-patch:8.2.5097: using uninitialized memory when using 'listchars' (#18985)
Problem:    Using uninitialized memory when using 'listchars'.
Solution:   Use the length returned by mb_char2bytes(). (closes vim/vim#10576)
74ac29cecd
			
			
This commit is contained in:
		| @@ -1812,8 +1812,8 @@ void msg_prt_line(char_u *s, int list) | ||||
|       } else if (curwin->w_p_lcs_chars.nbsp != NUL && list | ||||
|                  && (utf_ptr2char(s) == 160 | ||||
|                      || utf_ptr2char(s) == 0x202f)) { | ||||
|         utf_char2bytes(curwin->w_p_lcs_chars.nbsp, (char_u *)buf); | ||||
|         buf[utfc_ptr2len((char_u *)buf)] = NUL; | ||||
|         int len = utf_char2bytes(curwin->w_p_lcs_chars.nbsp, (char_u *)buf); | ||||
|         buf[len] = NUL; | ||||
|       } else { | ||||
|         memmove(buf, s, (size_t)l); | ||||
|         buf[l] = NUL; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 zeertzjq
					zeertzjq