From 80684a418b500cbd6a6f1f4e160ab0ff1d261c6e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 15 Mar 2026 06:26:21 +0800 Subject: [PATCH 1/3] vim-patch:9.2.0159: Crash when reading quickfix line Problem: Crash when reading quickfix line (Kaiyu Xie) Solution: Make sure line is terminated by NUL closes: vim/vim#19667 Supported by AI https://github.com/vim/vim/commit/8d13b8244a41d2457bc5049bdd0bb0238a754ede Co-authored-by: Christian Brabandt --- src/nvim/quickfix.c | 1 + test/old/testdir/test_quickfix.vim | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 75dae44478..f7eae6f825 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -815,6 +815,7 @@ retry: // Copy the read part of the line, excluding null-terminator memcpy(state->growbuf, IObuff, IOSIZE - 1); size_t growbuflen = state->linelen; + state->growbuf[growbuflen] = NUL; while (true) { errno = 0; diff --git a/test/old/testdir/test_quickfix.vim b/test/old/testdir/test_quickfix.vim index 7470e7d8ff..4eddec1e30 100644 --- a/test/old/testdir/test_quickfix.vim +++ b/test/old/testdir/test_quickfix.vim @@ -7014,4 +7014,19 @@ func Test_quickfixtextfunc_wipes_buffer() bw endfunc +func Test_quickfix_longline_noeol() + CheckRunVimInTerminal + let qf = 'Xquickfix' + let args = $"-q {qf}" + let after =<< trim [CODE] + call writefile(['okay'], "XDONE") + qall! + [CODE] + defer delete("XDONE") + call writefile([repeat('A', 1024)], qf, 'bD') + call RunVim([], after, args) + call WaitForAssert({-> assert_true(filereadable("XDONE"))}) + call assert_equal(['okay'], readfile("XDONE")) +endfunc + " vim: shiftwidth=2 sts=2 expandtab From 1aaa8e8e3ac90dd095c74ae3f2aa4be2a0a64cca Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 15 Mar 2026 06:27:23 +0800 Subject: [PATCH 2/3] vim-patch:9.2.0162: tests: unnecessary CheckRunVimInTerminal in test_quickfix Problem: tests: unnecessary CheckRunVimInTerminal in test_quickfix.vim (after v9.2.0159) Solution: Remove it (zeertzjq). closes: vim/vim#19671 https://github.com/vim/vim/commit/81d5329ace468b74c7ba29a72610e11d63f9f18f --- test/old/testdir/test_quickfix.vim | 1 - 1 file changed, 1 deletion(-) diff --git a/test/old/testdir/test_quickfix.vim b/test/old/testdir/test_quickfix.vim index 4eddec1e30..5c12e8592a 100644 --- a/test/old/testdir/test_quickfix.vim +++ b/test/old/testdir/test_quickfix.vim @@ -7015,7 +7015,6 @@ func Test_quickfixtextfunc_wipes_buffer() endfunc func Test_quickfix_longline_noeol() - CheckRunVimInTerminal let qf = 'Xquickfix' let args = $"-q {qf}" let after =<< trim [CODE] From 0082cd313485aa60811b1bdbe3c765f107ba1ba9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 15 Mar 2026 06:29:12 +0800 Subject: [PATCH 3/3] vim-patch:9.2.0165: tests: perleval fails in the sandbox Problem: tests: perleval fails in the sandbox (after v9.2.0156) Solution: Update tests and assert that it fails related: vim/vim#19676 https://github.com/vim/vim/commit/3f89324b3a7a7c88be19136227fbc9e1137cdb69 Co-authored-by: Christian Brabandt --- test/old/testdir/test_perl.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/old/testdir/test_perl.vim b/test/old/testdir/test_perl.vim index 2d7f8fdc10..275ec4c483 100644 --- a/test/old/testdir/test_perl.vim +++ b/test/old/testdir/test_perl.vim @@ -156,13 +156,13 @@ func Test_perleval() call assert_equal(0, perleval('0')) call assert_equal(2, perleval('2')) call assert_equal(-2, perleval('-2')) - if has('float') - call assert_equal(2.5, perleval('2.5')) - else - call assert_equal(2, perleval('2.5')) - end + call assert_equal(2.5, perleval('2.5')) - " sandbox call assert_equal(2, perleval('2')) + try + sandbox call perleval('2') + call assert_report('perleval did not fail in the sandbox') + catch /^Vim\%((\S\+)\)\=:E48:/ + endtry call assert_equal('abc', perleval('"abc"')) " call assert_equal("abc\ndef", perleval('"abc\0def"'))