1
0
forked from aniani/vim

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:
Bram Moolenaar
2016-11-13 14:31:40 +01:00
parent 3f7d090726
commit 8e63905263
3 changed files with 15 additions and 1 deletions

View File

@@ -92,3 +92,12 @@ func Test_win_getid()
only! only!
endfunc endfunc
func Test_win_getid_curtab()
tabedit X
tabfirst
copen
only
call assert_equal(win_getid(1), win_getid(1, 1))
tabclose!
endfunc

View File

@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
83,
/**/ /**/
82, 82,
/**/ /**/

View File

@@ -7133,6 +7133,9 @@ win_getid(typval_T *argvars)
break; break;
if (tp == NULL) if (tp == NULL)
return -1; return -1;
if (tp == curtab)
wp = firstwin;
else
wp = tp->tp_firstwin; wp = tp->tp_firstwin;
} }
for ( ; wp != NULL; wp = wp->w_next) for ( ; wp != NULL; wp = wp->w_next)