To: vim_dev@googlegroups.com Subject: Patch 8.0.1414 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1414 Problem: Accessing freed memory in :lfile. Solution: Get the current window after executing autocommands. (Yegappan Lakshmanan, closes #2473) Files: src/quickfix.c, src/testdir/test_quickfix.vim *** ../vim-8.0.1413/src/quickfix.c 2017-12-19 16:41:09.309369068 +0100 --- src/quickfix.c 2017-12-19 16:47:27.122936744 +0100 *************** *** 4068,4077 **** #endif int res; - if (eap->cmdidx == CMD_lfile || eap->cmdidx == CMD_lgetfile - || eap->cmdidx == CMD_laddfile) - wp = curwin; - #ifdef FEAT_AUTOCMD switch (eap->cmdidx) { --- 4068,4073 ---- *************** *** 4104,4109 **** --- 4100,4110 ---- if (*eap->arg != NUL) set_string_option_direct((char_u *)"ef", -1, eap->arg, OPT_FREE, 0); + if (eap->cmdidx == CMD_lfile + || eap->cmdidx == CMD_lgetfile + || eap->cmdidx == CMD_laddfile) + wp = curwin; + /* * This function is used by the :cfile, :cgetfile and :caddfile * commands. *** ../vim-8.0.1413/src/testdir/test_quickfix.vim 2017-12-19 12:38:47.446798184 +0100 --- src/testdir/test_quickfix.vim 2017-12-19 16:47:27.122936744 +0100 *************** *** 3031,3033 **** --- 3031,3040 ---- enew | only endfunc + " The following test used to crash vim + func Test_lfile_crash() + sp Xtest + au QuickFixCmdPre * bw + call assert_fails('lfile', 'E40') + au! QuickFixCmdPre + endfunc *** ../vim-8.0.1413/src/version.c 2017-12-19 16:41:09.309369068 +0100 --- src/version.c 2017-12-19 16:47:49.178794743 +0100 *************** *** 773,774 **** --- 773,776 ---- { /* Add new patch number below this line */ + /**/ + 1414, /**/ -- hundred-and-one symptoms of being an internet addict: 132. You come back and check this list every half-hour. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///