To: vim_dev@googlegroups.com Subject: Patch 8.2.3396 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3396 Problem: When libcall() fails invalid pointer may be used. Solution: Initialize the string to NULL. (Yasuhiro Matsumoto, closes #8829) Files: src/evalfunc.c *** ../vim-8.2.3395/src/evalfunc.c 2021-08-28 12:49:21.957091792 +0200 --- src/evalfunc.c 2021-09-02 19:52:45.134849664 +0200 *************** *** 6689,6697 **** --- 6689,6702 ---- if (argvars[2].v_type == VAR_STRING) string_in = argvars[2].vval.v_string; if (type == VAR_NUMBER) + { string_result = NULL; + } else + { + rettv->vval.v_string = NULL; string_result = &rettv->vval.v_string; + } if (mch_libcall(argvars[0].vval.v_string, argvars[1].vval.v_string, string_in, *** ../vim-8.2.3395/src/version.c 2021-09-02 18:49:02.748932320 +0200 --- src/version.c 2021-09-02 19:50:57.527113770 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3396, /**/ -- The only way the average employee can speak to an executive is by taking a second job as a golf caddie. (Scott Adams - The Dilbert principle) /// 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 ///