To: vim_dev@googlegroups.com Subject: Patch 8.2.3564 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3564 Problem: Invalid memory access when scrolling without a valid screen. Solution: Do not set VALID_BOTLINE in w_valid. Files: src/move.c, src/testdir/test_normal.vim *** ../vim-8.2.3563/src/move.c 2021-10-09 15:39:20.459884353 +0100 --- src/move.c 2021-10-25 17:05:17.215471975 +0100 *************** *** 199,205 **** check_cursor_lnum(); curwin->w_topline = curwin->w_cursor.lnum; curwin->w_botline = curwin->w_topline; - curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; curwin->w_scbind_pos = 1; return; } --- 199,204 ---- *** ../vim-8.2.3563/src/testdir/test_normal.vim 2021-07-15 11:48:08.811766844 +0100 --- src/testdir/test_normal.vim 2021-10-25 17:05:44.231811326 +0100 *************** *** 34,47 **** else silent exe "normal! `[v`]y" endif ! let g:a=strlen(substitute(@@, '[^ ]', '', 'g')) let &selection = sel_save let @@ = reg_save endfunc func OpfuncDummy(type, ...) " for testing operatorfunc ! let g:opt=&linebreak if a:0 " Invoked from Visual mode, use gv command. silent exe "normal! gvy" --- 34,47 ---- else silent exe "normal! `[v`]y" endif ! let g:a = strlen(substitute(@@, '[^ ]', '', 'g')) let &selection = sel_save let @@ = reg_save endfunc func OpfuncDummy(type, ...) " for testing operatorfunc ! let g:opt = &linebreak if a:0 " Invoked from Visual mode, use gv command. silent exe "normal! gvy" *************** *** 52,58 **** endif " Create a new dummy window new ! let g:bufnr=bufnr('%') endfunc func Test_normal00_optrans() --- 52,58 ---- endif " Create a new dummy window new ! let g:bufnr = bufnr('%') endfunc func Test_normal00_optrans() *************** *** 987,992 **** --- 987,1008 ---- close! endfunc + func Test_scroll_in_ex_mode() + " This was using invalid memory because w_botline was invalid. + let lines =<< trim END + diffsplit + norm os00( + call writefile(['done'], 'Xdone') + qa! + END + call writefile(lines, 'Xscript') + call assert_equal(1, RunVim([], [], '--clean -X -Z -e -s -S Xscript')) + call assert_equal(['done'], readfile('Xdone')) + + call delete('Xscript') + call delete('Xdone') + endfunc + " Test for the 'sidescroll' option func Test_sidescroll_opt() new *** ../vim-8.2.3563/src/version.c 2021-10-25 10:30:10.052617832 +0100 --- src/version.c 2021-10-25 17:05:55.423952006 +0100 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3564, /**/ -- "After a few years of marriage a man can look right at a woman without seeing her and a woman can see right through a man without looking at him." - Helen Rowland /// Bram Moolenaar -- Bram@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 ///