diff src/window.c @ 10377:dd397210a2d3 v8.0.0083

commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 13 14:31:40 2016 +0100 patch 8.0.0083 Problem: Using freed memory with win_getid(). (Domenique Pelle) Solution: For the current tab use curwin.
author Christian Brabandt <cb@256bit.org>
date Sun, 13 Nov 2016 14:45:03 +0100
parents 66f1b5bf3fa6
children c9da7f9137af
line wrap: on
line diff
--- a/src/window.c
+++ b/src/window.c
@@ -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)