From a8a097d178414e30ed758d332a74e649e43f105c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 29 Jan 2026 07:30:14 +0800 Subject: [PATCH] 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 --- test/old/testdir/test_statusline.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/old/testdir/test_statusline.vim b/test/old/testdir/test_statusline.vim index ebbc6e5443..f54a8b8064 100644 --- a/test/old/testdir/test_statusline.vim +++ b/test/old/testdir/test_statusline.vim @@ -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