diff --git a/backport-patch-9.1.0918-tiny-vim-crashes-with-fuzzy-buffer-completion.patch b/backport-patch-9.1.0918-tiny-vim-crashes-with-fuzzy-buffer-completion.patch new file mode 100644 index 0000000000000000000000000000000000000000..698fb9f76c075f08fb693853189a44856ff3e8be --- /dev/null +++ b/backport-patch-9.1.0918-tiny-vim-crashes-with-fuzzy-buffer-completion.patch @@ -0,0 +1,103 @@ +From dff3c9c1a789351a741b6a430862c8b2a0eff383 Mon Sep 17 00:00:00 2001 +From: 826814741_6 <44406129+826814741-6@users.noreply.github.com> +Date: Tue, 10 Dec 2024 17:15:14 +0100 +Subject: [PATCH] patch 9.1.0918: tiny Vim crashes with fuzzy buffer completion + +Problem: tiny Vim crashes with fuzzy buffer completion +Solution: Adjust #ifdefs in ExpandBufnames() (826814741_6) + +closes: #16200 + +Signed-off-by: h-east +Signed-off-by: 826814741_6 <44406129+826814741-6@users.noreply.github.com> +Signed-off-by: Christian Brabandt +--- + src/buffer.c | 4 ++-- + src/testdir/Make_all.mak | 6 ++++-- + src/testdir/test29.in | 14 ++++++++++++++ + src/testdir/test29.ok | 1 + + 4 files changed, 21 insertions(+), 4 deletions(-) + create mode 100644 src/testdir/test29.in + create mode 100644 src/testdir/test29.ok + +diff --git a/src/buffer.c b/src/buffer.c +index 3b05f25d7f705b..147d20dc78f0ff 100644 +--- a/src/buffer.c ++++ b/src/buffer.c +@@ -2902,9 +2902,9 @@ ExpandBufnames( + if (!fuzzy && patc != pat) + vim_free(patc); + +-#ifdef FEAT_VIMINFO + if (!fuzzy) + { ++#ifdef FEAT_VIMINFO + if (matches != NULL) + { + int i; +@@ -2924,13 +2924,13 @@ ExpandBufnames( + } + vim_free(matches); + } ++#endif + } + else + { + if (fuzzymatches_to_strmatches(fuzmatch, file, count, FALSE) == FAIL) + return FAIL; + } +-#endif + + *num_file = count; + return (count == 0 ? FAIL : OK); +diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak +index bdf058c1ec43a1..7285354838805a 100644 +--- a/src/testdir/Make_all.mak ++++ b/src/testdir/Make_all.mak +@@ -16,7 +16,8 @@ SCRIPTS_TINY = \ + test24 \ + test25 \ + test26 \ +- test27 ++ test27 \ ++ test29 + + SCRIPTS_TINY_OUT = \ + test20.out \ +@@ -26,7 +27,8 @@ SCRIPTS_TINY_OUT = \ + test24.out \ + test25.out \ + test26.out \ +- test27.out ++ test27.out \ ++ test29.out + + # Tests for Vim9 script. + TEST_VIM9 = \ +diff --git a/src/testdir/test29.in b/src/testdir/test29.in +new file mode 100644 +index 00000000000000..047803c60ff7bd +--- /dev/null ++++ b/src/testdir/test29.in +@@ -0,0 +1,14 @@ ++Test for buffer name completion when 'wildoptions' contains "fuzzy" ++(Confirm that Vim does not crash) ++ ++STARTTEST ++:set wildoptions=fuzzy ++:new buf_a ++:b buf_a ++:q! ++:set wildoptions& ++:$w! test.out ++:qa! ++ENDTEST ++ ++I'm alive! +diff --git a/src/testdir/test29.ok b/src/testdir/test29.ok +new file mode 100644 +index 00000000000000..6a0a7c94510a8e +--- /dev/null ++++ b/src/testdir/test29.ok +@@ -0,0 +1 @@ ++I'm alive! diff --git a/vim.spec b/vim.spec index 1fdc72f1ed5e864eb2ba20075dd2bedff2a8b607..70a7ddf7ce5b8c0c272aadd5ae61441dc9c146bf 100644 --- a/vim.spec +++ b/vim.spec @@ -12,7 +12,7 @@ Name: vim Epoch: 2 Version: 9.0 -Release: 29 +Release: 30 Summary: Vim is a highly configurable text editor for efficiently creating and changing any kind of text. License: Vim and MIT URL: http://www.vim.org @@ -127,6 +127,7 @@ Patch6097: backport-CVE-2024-41957.patch Patch6098: backport-CVE-2024-43374.patch Patch6099: backport-CVE-2024-43802.patch Patch6100: backport-patch-9.1.0730-crash-with-cursor-screenline-and-narrow-window.patch +Patch6101: backport-patch-9.1.0918-tiny-vim-crashes-with-fuzzy-buffer-completion.patch Patch9000: bugfix-rm-modify-info-version.patch Patch9001: vim-Add-sw64-architecture.patch @@ -538,6 +539,12 @@ LANG=en_US.UTF-8 make -j1 test %{_mandir}/man1/evim.* %changelog +* Fri Dec 13 2024 wangjiang - 2:9.0-30 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix tiny-Vim crashes with fuzzy buffer completion + * Tue Nov 12 2024 wangjiang - 2:9.0-29 - Type:bugfix - ID:NA