To: vim_dev@googlegroups.com Subject: Patch 9.0.1378 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 a0 + sil! exe "norm o00000\k