changeset 2099:c1f67ce5740a v7.2.382

updated for version 7.2.382 Problem: Accessing freed memory when closing the cmdline window when 'bufhide' is set to "wipe". Solution: Check if the buffer still exists before invoking close_buffer() (Dominique Pelle)
author Bram Moolenaar <bram@zimbu.org>
date Tue, 02 Mar 2010 17:23:21 +0100
parents 3259c3923c1e
children 7d121c69f540
files src/ex_getln.c src/version.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -6252,7 +6252,11 @@ ex_window()
 	bp = curbuf;
 	win_goto(old_curwin);
 	win_close(wp, TRUE);
-	close_buffer(NULL, bp, DOBUF_WIPE);
+
+	/* win_close() may have already wiped the buffer when 'bh' is
+	 * set to 'wipe' */
+	if (buf_valid(bp))
+	    close_buffer(NULL, bp, DOBUF_WIPE);
 
 	/* Restore window sizes. */
 	win_size_restore(&winsizes);
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    382,
+/**/
     381,
 /**/
     380,