To: vim_dev@googlegroups.com Subject: Patch 9.0.0212 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0212 Problem: Invalid memory access when compiling :unlet. Solution: Don't read past the end of the line. Files: src/vim9cmds.c, src/testdir/test_vim9_cmd.vim *** ../vim-9.0.0211/src/vim9cmds.c 2022-08-14 21:28:27.446201492 +0100 --- src/vim9cmds.c 2022-08-14 21:43:43.082516484 +0100 *************** *** 92,97 **** --- 92,103 ---- int check_vim9_unlet(char_u *name) { + if (*name == NUL) + { + semsg(_(e_argument_required_for_str), "unlet"); + return FAIL; + } + if (name[1] != ':' || vim_strchr((char_u *)"gwtb", *name) == NULL) { // "unlet s:var" is allowed in legacy script. *** ../vim-9.0.0211/src/testdir/test_vim9_cmd.vim 2022-08-14 21:28:27.446201492 +0100 --- src/testdir/test_vim9_cmd.vim 2022-08-14 21:43:36.726541151 +0100 *************** *** 1740,1751 **** lines =<< trim END def _() - s:0([], s:0) lockv enddef defcomp END ! v9.CheckScriptFailure(lines, 'E179', 2) enddef def Test_substitute_expr() --- 1740,1758 ---- lines =<< trim END def _() lockv enddef defcomp END ! v9.CheckScriptFailure(lines, 'E179', 1) ! ! lines =<< trim END ! def T() ! unlet ! enddef ! defcomp ! END ! v9.CheckScriptFailure(lines, 'E179', 1) enddef def Test_substitute_expr() *** ../vim-9.0.0211/src/version.c 2022-08-14 21:28:27.446201492 +0100 --- src/version.c 2022-08-14 21:44:43.442292545 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 212, /**/ -- 'I generally avoid temptation unless I can't resist it." -- Mae West /// 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 ///