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)

3f7be0d7e1
This commit is contained in:
zeertzjq
2026-01-29 07:30:14 +08:00
committed by GitHub
parent c7c5455da1
commit a8a097d178

View File

@@ -715,4 +715,18 @@ func Test_statusline_in_sandbox()
delfunc Check_statusline_in_sandbox delfunc Check_statusline_in_sandbox
endfunc 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`ÿæ\xE%#Normal#
vsp
setl stl=%#ErrorMsg#abcdtàØ?}}o@`s`ÿæ\xE%#Normal#
redraw!
redrawstatus
bw!
let [&columns, &ls, &stl, &enc] = [_columns, _ls, _stl, _enc]
endfunc
" vim: shiftwidth=2 sts=2 expandtab " vim: shiftwidth=2 sts=2 expandtab