Patch 8.1.2200
Problem:    Crash when memory allocation fails.
Solution:   Check for NULL curwin and curbuf. (Christian Brabandt,
            closes #4839)
Files:      src/getchar.c


*** ../vim-8.1.2199/src/getchar.c       2019-10-20 16:00:44.461152749 +0200
--- src/getchar.c       2019-10-22 21:53:52.789438279 +0200
***************
*** 2059,2066 ****
      void
  parse_queued_messages(void)
  {
!     int           old_curwin_id = curwin->w_id;
!     int           old_curbuf_fnum = curbuf->b_fnum;
      int           i;
      int           save_may_garbage_collect = may_garbage_collect;
      static int entered = 0;
--- 2059,2066 ----
      void
  parse_queued_messages(void)
  {
!     int           old_curwin_id;
!     int           old_curbuf_fnum;
      int           i;
      int           save_may_garbage_collect = may_garbage_collect;
      static int entered = 0;
***************
*** 2071,2076 ****
--- 2071,2084 ----
      if (updating_screen)
        return;
  
+     // If memory allocation fails during startup we'll exit but curbuf or
+     // curwin could be NULL.
+     if (curbuf == NULL || curwin == NULL)
+        return;
+ 
+     old_curbuf_fnum = curbuf->b_fnum;
+     old_curwin_id = curwin->w_id;
+ 
      ++entered;
  
      // may_garbage_collect is set in main_loop() to do garbage collection when
*** ../vim-8.1.2199/src/version.c       2019-10-22 21:45:15.950716560 +0200
--- src/version.c       2019-10-22 21:54:13.253374963 +0200
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     2200,
  /**/

-- 
DENNIS: Look,  strange women lying on their backs in ponds handing out
        swords ... that's no basis for a system of government.  Supreme
        executive power derives from a mandate from the masses, not from some
        farcical aquatic ceremony.
                 "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/ \\\
\\\  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/201910221955.x9MJtLs7020655%40masaka.moolenaar.net.

Raspunde prin e-mail lui