Patch 8.2.2474

5 views
Skip to first unread message

Bram Moolenaar

unread,
Feb 6, 2021, 1:20:45 PM2/6/21
to vim...@googlegroups.com

Patch 8.2.2474
Problem: Using freed memory when window is closed by autocommand.
(houyunsong)
Solution: Check the window pointer is still valid.
Files: src/quickfix.c, src/testdir/test_autocmd.vim


*** ../vim-8.2.2473/src/quickfix.c 2021-01-30 18:09:02.723958488 +0100
--- src/quickfix.c 2021-02-06 18:20:39.485415232 +0100
***************
*** 2603,2608 ****
--- 2603,2610 ----

if (wp != NULL)
{
+ if (!win_valid(wp))
+ return FALSE;
qi = GET_LOC_LIST(wp); // Location list
if (qi == NULL)
return FALSE;
*** ../vim-8.2.2473/src/testdir/test_autocmd.vim 2021-02-06 18:08:39.891834143 +0100
--- src/testdir/test_autocmd.vim 2021-02-06 19:18:15.078087715 +0100
***************
*** 2783,2786 ****
--- 2783,2800 ----
only
endfunc

+ func Test_autocmd_vimgrep()
+ augroup aucmd_vimgrep
+ au QuickfixCmdPre,BufNew,BufDelete,BufReadCmd * sb
+ au QuickfixCmdPre,BufNew,BufDelete,BufReadCmd * q9
Reply all
Reply to author
Forward
0 new messages