1
0
forked from aniani/vim

patch 7.4.1137

Problem:    Illegal memory access when using :copen and :cclose.
Solution:   Avoid that curbuf is invalid. (suggestion by Justin M. Keyes)
            Add a test.
This commit is contained in:
Bram Moolenaar
2016-01-19 14:51:54 +01:00
parent da5dcd9366
commit 62ef797496
3 changed files with 12 additions and 0 deletions

View File

@@ -2445,6 +2445,10 @@ win_close(win, free_buf)
if (win_valid(win))
win->w_closing = FALSE;
#endif
/* Make sure curbuf is valid. It can become invalid if 'bufhidden' is
* "wipe". */
if (!buf_valid(curbuf))
curbuf = firstbuf;
}
if (only_one_window() && win_valid(win) && win->w_buffer == NULL