Patch 8.1.1889
Problem:    Coverity warns for using a NULL pointer.
Solution:   Use zero for column if pos is NULL.
Files:      src/netbeans.c


*** ../vim-8.1.1888/src/netbeans.c      2019-05-28 23:08:12.068648696 +0200
--- src/netbeans.c      2019-08-19 20:03:44.705561824 +0200
***************
*** 1389,1405 ****
                            && ((pos != NULL && pos->col > 0)
                                || (lnum == 1 && buf_was_empty)))
                    {
!                       char_u *oldline = ml_get(lnum);
!                       char_u *newline;
  
                        /* Insert halfway a line. */
                        newline = alloc(STRLEN(oldline) + len + 1);
                        if (newline != NULL)
                        {
!                           mch_memmove(newline, oldline, (size_t)pos->col);
!                           newline[pos->col] = NUL;
                            STRCAT(newline, args);
!                           STRCAT(newline, oldline + pos->col);
                            ml_replace(lnum, newline, FALSE);
                        }
                    }
--- 1389,1406 ----
                            && ((pos != NULL && pos->col > 0)
                                || (lnum == 1 && buf_was_empty)))
                    {
!                       char_u  *oldline = ml_get(lnum);
!                       char_u  *newline;
!                       int     col = pos == NULL ? 0 : pos->col;
  
                        /* Insert halfway a line. */
                        newline = alloc(STRLEN(oldline) + len + 1);
                        if (newline != NULL)
                        {
!                           mch_memmove(newline, oldline, (size_t)col);
!                           newline[col] = NUL;
                            STRCAT(newline, args);
!                           STRCAT(newline, oldline + col);
                            ml_replace(lnum, newline, FALSE);
                        }
                    }
*** ../vim-8.1.1888/src/version.c       2019-08-18 23:01:33.725885954 +0200
--- src/version.c       2019-08-19 20:04:20.717407523 +0200
***************
*** 767,768 ****
--- 767,770 ----
  {   /* Add new patch number below this line */
+ /**/
+     1889,
  /**/

-- 
>From "know your smileys":
 :-)-O  Smiling doctor with stethoscope

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/201908191809.x7JI9oNs015662%40masaka.moolenaar.net.

Raspunde prin e-mail lui