To: vim_dev@googlegroups.com Subject: Patch 8.2.3847 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3847 Problem: Illegal memory access when using a lambda with an error. Solution: Avoid skipping over the NUL after a string. Files: src/eval.c, src/testdir/test_lambda.vim *** ../vim-8.2.3846/src/eval.c 2021-12-17 14:46:09.040354094 +0000 --- src/eval.c 2021-12-18 16:53:50.748010343 +0000 *************** *** 3871,3882 **** ++*arg; ret = eval1(arg, rettv, evalarg); *arg = skipwhite_and_linebreak(*arg, evalarg); ! if (**arg != ')') { emsg(_(e_missing_closing_paren)); ret = FAIL; } - ++*arg; } if (ret != OK) return FAIL; --- 3871,3885 ---- ++*arg; ret = eval1(arg, rettv, evalarg); *arg = skipwhite_and_linebreak(*arg, evalarg); ! if (**arg == ')') ! { ! ++*arg; ! } ! else { emsg(_(e_missing_closing_paren)); ret = FAIL; } } if (ret != OK) return FAIL; *** ../vim-8.2.3846/src/testdir/test_lambda.vim 2021-07-04 11:30:00.215304320 +0100 --- src/testdir/test_lambda.vim 2021-12-18 16:51:21.660238891 +0000 *************** *** 64,69 **** --- 64,71 ---- call assert_fails('echo {a, a -> a + a}(1, 2)', 'E853:') call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E451:') echo assert_fails('echo 10->{a -> a + 2}', 'E107:') + + call assert_fails('eval 0->(', "E110: Missing ')'") endfunc func Test_not_lamda() *** ../vim-8.2.3846/src/version.c 2021-12-18 15:32:38.064496744 +0000 --- src/version.c 2021-12-18 16:51:35.024219058 +0000 *************** *** 751,752 **** --- 751,754 ---- { /* Add new patch number below this line */ + /**/ + 3847, /**/ -- hundred-and-one symptoms of being an internet addict: 65. The last time you looked at the clock it was 11:30pm, and in what seems like only a few seconds later, your sister runs past you to catch her 7am school bus. /// 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 ///