Mercurial > vim
comparison src/structs.h @ 23869:5a4f9c5c1b99 v8.2.2476
patch 8.2.2476: using freed memory when splitting window while closing buffer
Commit: https://github.com/vim/vim/commit/983d83ff1cd796ff321074335fa53fbe7ac45a46
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 7 12:12:43 2021 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 07 Feb 2021 12:15:03 +0100 |
parents | 21a5d3aecd0e |
children | 4b417b776b95 |
comparison
equal
deleted
inserted
replaced
23868:1a97398d5e5a | 23869:5a4f9c5c1b99 |
---|---|
2631 int b_nwindows; // nr of windows open on this buffer | 2631 int b_nwindows; // nr of windows open on this buffer |
2632 | 2632 |
2633 int b_flags; // various BF_ flags | 2633 int b_flags; // various BF_ flags |
2634 int b_locked; // Buffer is being closed or referenced, don't | 2634 int b_locked; // Buffer is being closed or referenced, don't |
2635 // let autocommands wipe it out. | 2635 // let autocommands wipe it out. |
2636 int b_locked_split; // Buffer is being closed, don't allow opening | |
2637 // a new window with it. | |
2636 | 2638 |
2637 /* | 2639 /* |
2638 * b_ffname has the full path of the file (NULL for no name). | 2640 * b_ffname has the full path of the file (NULL for no name). |
2639 * b_sfname is the name as the user typed it (or NULL). | 2641 * b_sfname is the name as the user typed it (or NULL). |
2640 * b_fname is the same as b_sfname, unless ":cd" has been done, | 2642 * b_fname is the same as b_sfname, unless ":cd" has been done, |