jkunstle / rpms / vim

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