Patch 8.2.4938

9 views
Skip to first unread message

Bram Moolenaar

unread,
May 11, 2022, 6:43:08 AM5/11/22
to vim...@googlegroups.com

Patch 8.2.4938
Problem: Crash when matching buffer with invalid pattern.
Solution: Check for NULL regprog.
Files: src/buffer.c, src/testdir/test_buffer.vim


*** ../vim-8.2.4937/src/buffer.c 2022-05-09 21:03:30.777853315 +0100
--- src/buffer.c 2022-05-11 11:18:35.917407492 +0100
***************
*** 2932,2938 ****

// First try the short file name, then the long file name.
match = fname_match(rmp, buf->b_sfname, ignore_case);
! if (match == NULL)
match = fname_match(rmp, buf->b_ffname, ignore_case);

return match;
--- 2932,2938 ----

// First try the short file name, then the long file name.
match = fname_match(rmp, buf->b_sfname, ignore_case);
! if (match == NULL && rmp->regprog != NULL)
match = fname_match(rmp, buf->b_ffname, ignore_case);

return match;
*** ../vim-8.2.4937/src/testdir/test_buffer.vim 2022-05-07 11:28:02.189974238 +0100
--- src/testdir/test_buffer.vim 2022-05-11 11:23:37.393168207 +0100
***************
*** 415,420 ****
--- 415,424 ----
vsplit 0000000
silent! buf [0--]\&\zs*\zs*e
bwipe!
+
+ vsplit 00000000000000000000000000
+ silent! buf [0--]\&\zs*\zs*e
+ bwipe!
endfunc

" Test for the 'maxmem' and 'maxmemtot' options
*** ../vim-8.2.4937/src/version.c 2022-05-10 21:11:09.324126665 +0100
--- src/version.c 2022-05-11 11:19:40.817349798 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4938,
/**/

--
hundred-and-one symptoms of being an internet addict:
170. You introduce your wife as "my_...@home.wife" and refer to your
children as "forked processes."

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages