mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.0083
Problem: Using freed memory with win_getid(). (Domenique Pelle) Solution: For the current tab use curwin.
This commit is contained in:
@@ -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
|
||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
83,
|
||||
/**/
|
||||
82,
|
||||
/**/
|
||||
|
@@ -7133,7 +7133,10 @@ win_getid(typval_T *argvars)
|
||||
break;
|
||||
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)
|
||||
|
Reference in New Issue
Block a user