1
0
forked from aniani/vim

patch 8.2.2476: using freed memory when splitting window while closing buffer

Problem:    Using freed memory when using an autocommand to split a window
            while a buffer is being closed.
Solution:   Disallow splitting when the buffer has b_locked_split set.
This commit is contained in:
Bram Moolenaar
2021-02-07 12:12:43 +01:00
parent dfc3db76b9
commit 983d83ff1c
7 changed files with 26 additions and 11 deletions

View File

@@ -2633,6 +2633,8 @@ struct file_buffer
int b_flags; // various BF_ flags
int b_locked; // Buffer is being closed or referenced, don't
// let autocommands wipe it out.
int b_locked_split; // Buffer is being closed, don't allow opening
// a new window with it.
/*
* b_ffname has the full path of the file (NULL for no name).