mirror of
https://github.com/neovim/neovim.git
synced 2024-12-22 04:05:09 -07:00
vim-patch:8.0.0083
Problem: Using freed memory with win_getid(). (Domenique Pelle)
Solution: For the current tab use curwin.
8e63905263
This commit is contained in:
parent
9c8540edfd
commit
b82e3358e0
@ -92,3 +92,12 @@ func Test_win_getid()
|
||||
|
||||
only!
|
||||
endfunc
|
||||
|
||||
func Test_win_getid_curtab()
|
||||
tabedit X
|
||||
tabfirst
|
||||
copen
|
||||
only
|
||||
call assert_equal(win_getid(1), win_getid(1, 1))
|
||||
tabclose!
|
||||
endfunc
|
||||
|
@ -5821,7 +5821,11 @@ int win_getid(typval_T *argvars)
|
||||
if (tp == NULL) {
|
||||
return -1;
|
||||
}
|
||||
wp = tp->tp_firstwin;
|
||||
if (tp == curtab) {
|
||||
wp = firstwin;
|
||||
} else {
|
||||
wp = tp->tp_firstwin;
|
||||
}
|
||||
}
|
||||
for ( ; wp != NULL; wp = wp->w_next) {
|
||||
if (--winnr == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user