Patch 9.0.1378

4 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 4, 2023, 9:14:08 AM3/4/23
to vim...@googlegroups.com

Patch 9.0.1378
Problem: Illegal memory access when using virtual editing.
Solution: Make sure "startspaces" is not negative.
Files: src/register.c, src/testdir/test_virtualedit.vim


*** ../vim-9.0.1377/src/register.c 2023-03-03 21:11:49.057414112 +0000
--- src/register.c 2023-03-04 14:11:40.678540655 +0000
***************
*** 1245,1250 ****
--- 1245,1252 ----
// double-count it.
bd.startspaces = (ce - cs + 1)
- oap->start.coladd;
+ if (bd.startspaces < 0)
+ bd.startspaces = 0;
startcol++;
}
}
*** ../vim-9.0.1377/src/testdir/test_virtualedit.vim 2023-01-28 19:18:56.741720608 +0000
--- src/testdir/test_virtualedit.vim 2023-03-04 14:10:43.066521272 +0000
***************
*** 88,93 ****
--- 88,103 ----
set virtualedit=
endfunc

+ func Test_edit_special_char()
+ new
+ se ve=all
+ norm a 0
+ sil! exe "norm o00000\<Nul>k<a0s"
+
+ bwipe!
+ set virtualedit=
+ endfunc
+
" Tests for pasting at the beginning, end and middle of a tab character
" in virtual edit mode.
func Test_paste_in_tab()
*** ../vim-9.0.1377/src/version.c 2023-03-04 13:23:22.969812280 +0000
--- src/version.c 2023-03-04 14:09:04.498485723 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1378,
/**/

--
Your fault: core dumped

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