From 8e639052638a9bb8c7dd6e3e10776b1218cec1a3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 13 Nov 2016 14:31:40 +0100 Subject: patch 8.0.0083 Problem: Using freed memory with win_getid(). (Domenique Pelle) Solution: For the current tab use curwin. --- src/window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 8e5336883..ee5f7aa8a 100644 --- 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) -- cgit v1.2.1