To: vim_dev@googlegroups.com Subject: Patch 8.2.3380 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3380 Problem: Crash when using NULL string for funcref(). Solution: Check for NULL argument. (issue #8260) Files: src/evalfunc.c, src/testdir/test_expr.vim *** ../vim-8.2.3379/src/evalfunc.c 2021-08-19 21:20:36.705042718 +0200 --- src/evalfunc.c 2021-08-28 12:45:59.265787038 +0200 *************** *** 3932,3937 **** --- 3932,3942 ---- s = tv_get_string(&argvars[0]); use_string = TRUE; } + if (s == NULL) + { + semsg(_(e_invarg2), "NULL"); + return; + } if ((use_string && vim_strchr(s, AUTOLOAD_CHAR) == NULL) || is_funcref) { *** ../vim-8.2.3379/src/testdir/test_expr.vim 2021-05-25 20:13:56.316778428 +0200 --- src/testdir/test_expr.vim 2021-08-28 12:48:55.405182854 +0200 *************** *** 501,506 **** --- 501,507 ---- let OneByRef = funcref("One", repeat(["foo"], 20)) call assert_fails('let OneByRef = funcref("One", repeat(["foo"], 21))', 'E118:') call assert_fails('echo function("min") =~ function("min")', 'E694:') + call assert_fails('echo test_null_function()->funcref()', 'E475: Invalid argument: NULL') endfunc func Test_setmatches() *** ../vim-8.2.3379/src/version.c 2021-08-28 12:30:09.689044139 +0200 --- src/version.c 2021-08-28 12:48:19.049307519 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3380, /**/ -- "Lisp has all the visual appeal of oatmeal with nail clippings thrown in." -- Larry Wall /// 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 ///