Karsten Hopp 3c512f
To: vim-dev@vim.org
Karsten Hopp 3c512f
Subject: Patch 7.2.382
Karsten Hopp 3c512f
Fcc: outbox
Karsten Hopp 3c512f
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 3c512f
Mime-Version: 1.0
Karsten Hopp 3c512f
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 3c512f
Content-Transfer-Encoding: 8bit
Karsten Hopp 3c512f
------------
Karsten Hopp 3c512f
Karsten Hopp 3c512f
Patch 7.2.382
Karsten Hopp 3c512f
Problem:    Accessing freed memory when closing the cmdline window when
Karsten Hopp 3c512f
	    'bufhide' is set to "wipe".
Karsten Hopp 3c512f
Solution:   Check if the buffer still exists before invoking close_buffer()
Karsten Hopp 3c512f
	    (Dominique Pelle)
Karsten Hopp 3c512f
Files:	    src/ex_getln.c
Karsten Hopp 3c512f
Karsten Hopp 3c512f
Karsten Hopp 3c512f
*** ../vim-7.2.381/src/ex_getln.c	2010-03-02 15:55:51.000000000 +0100
Karsten Hopp 3c512f
--- src/ex_getln.c	2010-03-02 16:29:38.000000000 +0100
Karsten Hopp 3c512f
***************
Karsten Hopp 3c512f
*** 6252,6258 ****
Karsten Hopp 3c512f
  	bp = curbuf;
Karsten Hopp 3c512f
  	win_goto(old_curwin);
Karsten Hopp 3c512f
  	win_close(wp, TRUE);
Karsten Hopp 3c512f
! 	close_buffer(NULL, bp, DOBUF_WIPE);
Karsten Hopp 3c512f
  
Karsten Hopp 3c512f
  	/* Restore window sizes. */
Karsten Hopp 3c512f
  	win_size_restore(&winsizes);
Karsten Hopp 3c512f
--- 6252,6262 ----
Karsten Hopp 3c512f
  	bp = curbuf;
Karsten Hopp 3c512f
  	win_goto(old_curwin);
Karsten Hopp 3c512f
  	win_close(wp, TRUE);
Karsten Hopp 3c512f
! 
Karsten Hopp 3c512f
! 	/* win_close() may have already wiped the buffer when 'bh' is
Karsten Hopp 3c512f
! 	 * set to 'wipe' */
Karsten Hopp 3c512f
! 	if (buf_valid(bp))
Karsten Hopp 3c512f
! 	    close_buffer(NULL, bp, DOBUF_WIPE);
Karsten Hopp 3c512f
  
Karsten Hopp 3c512f
  	/* Restore window sizes. */
Karsten Hopp 3c512f
  	win_size_restore(&winsizes);
Karsten Hopp 3c512f
*** ../vim-7.2.381/src/version.c	2010-03-02 15:55:51.000000000 +0100
Karsten Hopp 3c512f
--- src/version.c	2010-03-02 17:22:11.000000000 +0100
Karsten Hopp 3c512f
***************
Karsten Hopp 3c512f
*** 683,684 ****
Karsten Hopp 3c512f
--- 683,686 ----
Karsten Hopp 3c512f
  {   /* Add new patch number below this line */
Karsten Hopp 3c512f
+ /**/
Karsten Hopp 3c512f
+     382,
Karsten Hopp 3c512f
  /**/
Karsten Hopp 3c512f
Karsten Hopp 3c512f
-- 
Karsten Hopp 3c512f
You had connectors?  Eeee, when I were a lad we 'ad to carry the
Karsten Hopp 3c512f
bits between the computer and the terminal with a spoon...
Karsten Hopp 3c512f
Karsten Hopp 3c512f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 3c512f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 3c512f
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 3c512f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///