mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
vim-patch:9.0.0579: using freed memory when 'tagfunc' wipes out buffer (#24838)
Problem: Using freed memory when 'tagfunc' wipes out buffer that holds
'complete'.
Solution: Make a copy of the option. Make sure cursor position is valid.
0ff01835a4
Cherry-pick a cmdwin change from patch 9.0.0500.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -4572,7 +4572,8 @@ static int open_cmdwin(void)
|
||||
ccline.cmdlen = (int)strlen(ccline.cmdbuff);
|
||||
ccline.cmdbufflen = ccline.cmdlen + 1;
|
||||
ccline.cmdpos = curwin->w_cursor.col;
|
||||
if (ccline.cmdpos > ccline.cmdlen) {
|
||||
// If the cursor is on the last character, it probably should be after it.
|
||||
if (ccline.cmdpos == ccline.cmdlen - 1 || ccline.cmdpos > ccline.cmdlen) {
|
||||
ccline.cmdpos = ccline.cmdlen;
|
||||
}
|
||||
if (cmdwin_result == K_IGNORE) {
|
||||
|
Reference in New Issue
Block a user