mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
vim-patch:9.1.0764: [security]: use-after-free when closing a buffer (#30705)
Problem: [security]: use-after-free when closing a buffer
Solution: When splitting the window and editing a new buffer,
check whether the newly to be edited buffer has been marked
for deletion and abort in this case
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-rj48-v4mq-j4vg
51b62387be
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -478,6 +478,11 @@ static bool can_unload_buffer(buf_T *buf)
|
||||
return can_unload;
|
||||
}
|
||||
|
||||
bool buf_locked(buf_T *buf)
|
||||
{
|
||||
return buf->b_locked || buf->b_locked_split;
|
||||
}
|
||||
|
||||
/// Close the link to a buffer.
|
||||
///
|
||||
/// @param win If not NULL, set b_last_cursor.
|
||||
|
Reference in New Issue
Block a user