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 *)"<SNR>", 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 *)"<SNR>", 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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220113120539.C18181C04C1%40moolenaar.net.

Raspunde prin e-mail lui