summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-12-30 15:01:59 +0100
committerBram Moolenaar <Bram@vim.org>2011-12-30 15:01:59 +0100
commitfc57380c3f1370c26b8c1eddcf9bccbad58e11aa (patch)
tree83291ac1aab0c1172618691576dcb4ed3a46f1b4 /src/ex_cmds.c
parent5d6f75e17e783b4ce6702b243cf8fda107592e87 (diff)
downloadvim-git-fc57380c3f1370c26b8c1eddcf9bccbad58e11aa.tar.gz
updated for version 7.3.390v7.3.390
Problem: Using NULL buffer pointer in a window. Solution: Check for w_buffer being NULL in more places. (Bjorn Winckler)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index e81b4a2be..519655beb 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3390,6 +3390,13 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
(flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
#ifdef FEAT_AUTOCMD
+ /* Autocommands may open a new window and leave oldwin open
+ * which leads to crashes since the above call sets
+ * oldwin->w_buffer to NULL. */
+ if (curwin != oldwin && oldwin != aucmd_win
+ && win_valid(oldwin) && oldwin->w_buffer == NULL)
+ win_close(oldwin, FALSE);
+
# ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
{