mirror of
https://github.com/neovim/neovim.git
synced 2026-10-28 00:20:21 -05:00
vim-patch:9.1.2112: long statusline may crash if using singlebyte encoding (#37605)
Problem: long statusline may crash if using singlebyte encoding
(fizz-is-on-the-way)
Solution: Drop the non-mbyte codepath and always use the mbyte code
(zeertzjq)
https://github.com/vim/vim/commit/3f7be0d7e1a394797c44090cdb9a231f1424187d
This commit is contained in:
1 parent
c7c5455da1
commit
a8a097d178
1 file changed
+14
@@ -715,4 +715,18 @@ func Test_statusline_in_sandbox()
|
||||
delfunc Check_statusline_in_sandbox
|
||||
endfunc
|
||||
|
||||
" This used to call memmove with a negative size and crash Vim
|
||||
func Test_statusline_singlebyte_negative()
|
||||
let [_columns, _ls, _stl, _enc] = [&columns, &ls, &stl, &enc]
|
||||
" set encoding=latin1
|
||||
set laststatus=2 columns=15
|
||||
setl stl=%#ErrorMsg#abcdtàØ?}}o@`s`ÿæCú\xE%#Normal#
|
||||
vsp
|
||||
setl stl=%#ErrorMsg#abcdtàØ?}}o@`s`ÿæCú\xE%#Normal#
|
||||
redraw!
|
||||
redrawstatus
|
||||
bw!
|
||||
let [&columns, &ls, &stl, &enc] = [_columns, _ls, _stl, _enc]
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
Reference in new issue
Block a user