From b82e3358e006264187f104bb0321104621bcc811 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 21 Mar 2017 19:23:12 +0100 Subject: vim-patch:8.0.0083 Problem: Using freed memory with win_getid(). (Domenique Pelle) Solution: For the current tab use curwin. https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3 --- src/nvim/window.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nvim/window.c') diff --git a/src/nvim/window.c b/src/nvim/window.c index 15482d9061..ce322e1185 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -5821,7 +5821,11 @@ int win_getid(typval_T *argvars) 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