Permalink
Browse files

patch 8.0.0083

Problem:    Using freed memory with win_getid(). (Domenique Pelle)
Solution:   For the current tab use curwin.
  • Loading branch information...
1 parent 3f7d090 commit 8e639052638a9bb8c7dd6e3e10776b1218cec1a3 @brammool brammool committed Nov 13, 2016
Showing with 15 additions and 1 deletion.
  1. +9 −0 src/testdir/test_window_id.vim
  2. +2 −0 src/version.c
  3. +4 −1 src/window.c
@@ -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
View
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 83,
+/**/
82,
/**/
81,
View
@@ -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)

0 comments on commit 8e63905

Please sign in to comment.