summaryrefslogtreecommitdiff
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-03-02 17:23:21 +0100
committerBram Moolenaar <Bram@vim.org>2010-03-02 17:23:21 +0100
commit8006d69d3c05ef92f5915984baae79ef832380e5 (patch)
treec2c1874a31c2170b19d0a16c19323f58f4b53f43 /src/ex_getln.c
parent5e3dae8b6ba205faf78af4b6eaeb5947c309ca59 (diff)
downloadvim-git-8006d69d3c05ef92f5915984baae79ef832380e5.tar.gz
updated for version 7.2.382v7.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)
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 6b5a824bd..0f0f17075 100644
--- 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);