From 761e920280ccedb823a56b9da7f02aaf4e1051aa Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 6 Mar 2025 07:08:53 +0800 Subject: vim-patch:9.1.1172: [security]: overflow with 'nostartofline' and Ex command in tag file (#32739) Problem: heap-buffer-overflow with 'nostartofline' and Ex command in tag file. Solution: Set cursor column when moving cursor to line 1 (zeertzjq). closes: vim/vim#16796 https://github.com/vim/vim/commit/3ed6659549e447ff00def8edc841321e497f70a8 --- test/old/testdir/test_tagjump.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_tagjump.vim b/test/old/testdir/test_tagjump.vim index efc5e4cebe..74ae4a6c73 100644 --- a/test/old/testdir/test_tagjump.vim +++ b/test/old/testdir/test_tagjump.vim @@ -1696,4 +1696,21 @@ func Test_tag_guess_short() set tags& cpoptions-=t endfunc +func Test_tag_excmd_with_nostartofline() + call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", + \ "f\tXfile\tascii"], + \ 'Xtags', 'D') + call writefile(['f', 'foobar'], 'Xfile', 'D') + + set nostartofline + new Xfile + setlocal tags=Xtags + normal! G$ + " This used to cause heap-buffer-overflow + tag f + + bwipe! + set startofline& +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit