Patch 8.2.4440

5 views
Skip to first unread message

Bram Moolenaar

unread,
Feb 22, 2022, 8:38:12 AM2/22/22
to vim...@googlegroups.com

Patch 8.2.4440
Problem: Crash with specific regexp pattern and string.
Solution: Stop at the start of the string.
Files: src/regexp_bt.c, src/testdir/test_regexp_utf8.vim


*** ../vim-8.2.4439/src/regexp_bt.c 2022-01-31 14:59:33.522943638 +0000
--- src/regexp_bt.c 2022-02-22 13:34:08.427901789 +0000
***************
*** 4615,4620 ****
--- 4615,4625 ----
if (rex.input == rex.line)
{
// backup to last char of previous line
+ if (rex.lnum == 0)
+ {
+ status = RA_NOMATCH;
+ break;
+ }
--rex.lnum;
rex.line = reg_getline(rex.lnum);
// Just in case regrepeat() didn't count
*** ../vim-8.2.4439/src/testdir/test_regexp_utf8.vim 2022-01-31 14:59:33.526943578 +0000
--- src/testdir/test_regexp_utf8.vim 2022-02-22 13:33:02.360143358 +0000
***************
*** 508,514 ****
" Check that [[:upper:]] matches for automatic engine
func Test_match_char_class_upper()
new
- let _engine=&regexpengine

" Test 1: [[:upper:]]\{2,\}
set regexpengine=0
--- 508,513 ----
***************
*** 549,555 ****
call assert_equal(4, searchcount().total, 'TEST 3 lower')

" clean up
! let &regexpengine=_engine
bwipe!
endfunc

--- 548,554 ----
call assert_equal(4, searchcount().total, 'TEST 3 lower')

" clean up
! set regexpengine=0
bwipe!
endfunc

***************
*** 561,564 ****
--- 560,572 ----
call delete('Xinvalid')
endfunc

+ func Test_match_too_complicated()
+ set regexpengine=1
+ exe "vsplit \xeb\xdb\x99"
+ silent! buf \&\zs*\zs*0
+ bwipe!
+ set regexpengine=0
+ endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.4439/src/version.c 2022-02-22 12:34:21.387356125 +0000
--- src/version.c 2022-02-22 13:35:03.939709698 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4440,
/**/

--
You can't have everything. Where would you put it?
-- Steven Wright

/// 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