To: vim_dev@googlegroups.com Subject: Patch 8.2.4073 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4073 Problem: Coverity warns for using NULL pointer. Solution: Bail out when running out of memory. Check for running over end of a string. Files: src/userfunc.c, *** ../vim-8.2.4072/src/userfunc.c 2022-01-12 12:48:07.510194380 +0000 --- src/userfunc.c 2022-01-13 12:03:56.989854471 +0000 *************** *** 1674,1685 **** void emsg_funcname(char *ermsg, char_u *name) { ! char_u *p; ! if (*name == K_SPECIAL) p = concat_str((char_u *)"", name + 3); - else - p = name; semsg(_(ermsg), p); if (p != name) vim_free(p); --- 1674,1683 ---- void emsg_funcname(char *ermsg, char_u *name) { ! char_u *p = name; ! if (name[0] == K_SPECIAL && name[1] != NUL && name[2] != NUL) p = concat_str((char_u *)"", name + 3); semsg(_(ermsg), p); if (p != name) vim_free(p); *************** *** 4154,4159 **** --- 4152,4159 ---- else eap->skip = TRUE; } + if (name == NULL) + goto ret_free; // out of memory // For "export def FuncName()" in an autoload script the function name // is stored with the legacy autoload name "dir#script#FuncName" so *** ../vim-8.2.4072/src/version.c 2022-01-12 19:47:00.343543324 +0000 --- src/version.c 2022-01-13 12:04:32.545572150 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4073, /**/ -- GALAHAD: No, please. Please! I can defeat them! There's only a hundred. GIRLS: He will beat us easily. We haven't a chance. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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 ///