To: vim_dev@googlegroups.com Subject: Patch 8.1.0068 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0068 Problem: Nasty autocommands can still cause using freed memory. Solution: Disallow using setloclist() and setqflist() recursively. Files: src/evalfunc.c *** ../vim-8.1.0067/src/evalfunc.c 2018-06-12 20:25:47.887923393 +0200 --- src/evalfunc.c 2018-06-17 19:16:21.949606435 +0200 *************** *** 10621,10626 **** --- 10652,10658 ---- static char *e_invact = N_("E927: Invalid action: '%s'"); char_u *act; int action = 0; + static int recursive = 0; #endif rettv->vval.v_number = -1; *************** *** 10628,10633 **** --- 10660,10667 ---- #ifdef FEAT_QUICKFIX if (list_arg->v_type != VAR_LIST) EMSG(_(e_listreq)); + else if (recursive != 0) + EMSG(_(e_au_recursive)); else { list_T *l = list_arg->vval.v_list; *************** *** 10662,10670 **** } } if (l != NULL && action && valid_dict && set_errorlist(wp, l, action, ! (char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"), d) == OK) rettv->vval.v_number = 0; } #endif } --- 10696,10707 ---- } } + ++recursive; if (l != NULL && action && valid_dict && set_errorlist(wp, l, action, ! (char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"), ! d) == OK) rettv->vval.v_number = 0; + --recursive; } #endif } *** ../vim-8.1.0067/src/version.c 2018-06-17 19:08:26.476323920 +0200 --- src/version.c 2018-06-17 19:17:27.305233384 +0200 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 68, /**/ -- hundred-and-one symptoms of being an internet addict: 63. You start using smileys in your snail mail. /// 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 ///