comparison src/evalwindow.c @ 19114:3856047f2211 v8.2.0117

patch 8.2.0117: crash when using gettabwinvar() with invalid arguments Commit: https://github.com/vim/vim/commit/ee93b737aaa7bf65edc7281f429dd89fcf657a6f Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 14 19:05:39 2020 +0100 patch 8.2.0117: crash when using gettabwinvar() with invalid arguments Problem: Crash when using gettabwinvar() with invalid arguments. (Yilin Yang) Solution: Use "curtab" if "tp" is NULL. (closes #5475)
author Bram Moolenaar <Bram@vim.org>
date Tue, 14 Jan 2020 19:15:04 +0100
parents ef3633932b0c
children 1d6bc6b31c2e
comparison
equal deleted inserted replaced
19113:4858db718203 19114:3856047f2211
181 } 181 }
182 if (nr >= LOWEST_WIN_ID) 182 if (nr >= LOWEST_WIN_ID)
183 { 183 {
184 #ifdef FEAT_PROP_POPUP 184 #ifdef FEAT_PROP_POPUP
185 // check tab-local popup windows 185 // check tab-local popup windows
186 for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next) 186 for (wp = (tp == NULL ? curtab : tp)->tp_first_popupwin;
187 wp != NULL; wp = wp->w_next)
187 if (wp->w_id == nr) 188 if (wp->w_id == nr)
188 return wp; 189 return wp;
189 // check global popup windows 190 // check global popup windows
190 for (wp = first_popupwin; wp != NULL; wp = wp->w_next) 191 for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
191 if (wp->w_id == nr) 192 if (wp->w_id == nr)