Karsten Hopp 6eb53f
To: vim_dev@googlegroups.com
Karsten Hopp 6eb53f
Subject: Patch 7.4.369
Karsten Hopp 6eb53f
Fcc: outbox
Karsten Hopp 6eb53f
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 6eb53f
Mime-Version: 1.0
Karsten Hopp 6eb53f
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 6eb53f
Content-Transfer-Encoding: 8bit
Karsten Hopp 6eb53f
------------
Karsten Hopp 6eb53f
Karsten Hopp 6eb53f
Patch 7.4.369
Karsten Hopp 6eb53f
Problem:    Using freed memory when exiting while compiled with EXITFREE.
Karsten Hopp 6eb53f
Solution:   Set curwin to NULL and check for that. (Dominique Pelle)
Karsten Hopp 6eb53f
Files:	    src/buffer.c, src/window.c
Karsten Hopp 6eb53f
Karsten Hopp 6eb53f
Karsten Hopp 6eb53f
*** ../vim-7.4.368/src/buffer.c	2014-06-12 14:01:27.571769788 +0200
Karsten Hopp 6eb53f
--- src/buffer.c	2014-07-16 16:20:04.443621254 +0200
Karsten Hopp 6eb53f
***************
Karsten Hopp 6eb53f
*** 5702,5709 ****
Karsten Hopp 6eb53f
      signlist_T	*next;
Karsten Hopp 6eb53f
  
Karsten Hopp 6eb53f
      /* When deleting the last sign need to redraw the windows to remove the
Karsten Hopp 6eb53f
!      * sign column. */
Karsten Hopp 6eb53f
!     if (buf->b_signlist != NULL)
Karsten Hopp 6eb53f
      {
Karsten Hopp 6eb53f
  	redraw_buf_later(buf, NOT_VALID);
Karsten Hopp 6eb53f
  	changed_cline_bef_curs();
Karsten Hopp 6eb53f
--- 5702,5709 ----
Karsten Hopp 6eb53f
      signlist_T	*next;
Karsten Hopp 6eb53f
  
Karsten Hopp 6eb53f
      /* When deleting the last sign need to redraw the windows to remove the
Karsten Hopp 6eb53f
!      * sign column. Not when curwin is NULL (this means we're exiting). */
Karsten Hopp 6eb53f
!     if (buf->b_signlist != NULL && curwin != NULL)
Karsten Hopp 6eb53f
      {
Karsten Hopp 6eb53f
  	redraw_buf_later(buf, NOT_VALID);
Karsten Hopp 6eb53f
  	changed_cline_bef_curs();
Karsten Hopp 6eb53f
*** ../vim-7.4.368/src/window.c	2014-07-16 15:18:22.903696486 +0200
Karsten Hopp 6eb53f
--- src/window.c	2014-07-16 16:15:41.063626607 +0200
Karsten Hopp 6eb53f
***************
Karsten Hopp 6eb53f
*** 2489,2494 ****
Karsten Hopp 6eb53f
--- 2489,2498 ----
Karsten Hopp 6eb53f
  
Karsten Hopp 6eb53f
      while (firstwin != NULL)
Karsten Hopp 6eb53f
  	(void)win_free_mem(firstwin, &dummy, NULL);
Karsten Hopp 6eb53f
+ 
Karsten Hopp 6eb53f
+     /* No window should be used after this. Set curwin to NULL to crash
Karsten Hopp 6eb53f
+      * instead of using freed memory. */
Karsten Hopp 6eb53f
+     curwin = NULL;
Karsten Hopp 6eb53f
  }
Karsten Hopp 6eb53f
  #endif
Karsten Hopp 6eb53f
  
Karsten Hopp 6eb53f
*** ../vim-7.4.368/src/version.c	2014-07-16 15:18:22.907696486 +0200
Karsten Hopp 6eb53f
--- src/version.c	2014-07-16 16:18:36.827623035 +0200
Karsten Hopp 6eb53f
***************
Karsten Hopp 6eb53f
*** 736,737 ****
Karsten Hopp 6eb53f
--- 736,739 ----
Karsten Hopp 6eb53f
  {   /* Add new patch number below this line */
Karsten Hopp 6eb53f
+ /**/
Karsten Hopp 6eb53f
+     369,
Karsten Hopp 6eb53f
  /**/
Karsten Hopp 6eb53f
Karsten Hopp 6eb53f
-- 
Karsten Hopp 6eb53f
ARTHUR: If you do not open these doors, we will take this castle by force ...
Karsten Hopp 6eb53f
   [A bucket of slops land on ARTHUR.  He tries to retain his dignity.]
Karsten Hopp 6eb53f
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 6eb53f
Karsten Hopp 6eb53f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 6eb53f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 6eb53f
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 6eb53f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///