Patch 8.2.1843
Problem:    Netbeans: with huge buffer number memory allocation may fail.
Solution:   Check for size overflow.
Files:      src/netbeans.c


*** ../vim-8.2.1842/src/netbeans.c      2020-04-19 14:02:22.427687032 +0200
--- src/netbeans.c      2020-10-13 21:09:55.880051169 +0200
***************
*** 674,684 ****
      {
        if (bufno >= buf_list_size) // grow list
        {
!           nbbuf_T *t_buf_list = buf_list;
  
            incr = bufno - buf_list_size + 90;
            buf_list_size += incr;
!           buf_list = vim_realloc(buf_list, buf_list_size * sizeof(nbbuf_T));
            if (buf_list == NULL)
            {
                vim_free(t_buf_list);
--- 674,692 ----
      {
        if (bufno >= buf_list_size) // grow list
        {
!           nbbuf_T     *t_buf_list = buf_list;
!           size_t      bufsize;
  
            incr = bufno - buf_list_size + 90;
            buf_list_size += incr;
!           bufsize = buf_list_size * sizeof(nbbuf_T);
!           if (bufsize == 0 || bufsize / sizeof(nbbuf_T)
!                                                     != (size_t)buf_list_size)
!           {
!               // list size overflow, bail out
!               return NULL;
!           }
!           buf_list = vim_realloc(buf_list, bufsize);
            if (buf_list == NULL)
            {
                vim_free(t_buf_list);
*** ../vim-8.2.1842/src/version.c       2020-10-13 19:08:20.271560493 +0200
--- src/version.c       2020-10-13 21:08:32.992320734 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     1843,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
85. Choice between paying Compuserve bill and paying for kids education
    is a no brainer -- although a bit painful for your kids.

 /// 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/202010131911.09DJBjsF410253%40masaka.moolenaar.net.

Raspunde prin e-mail lui