• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision3856047f2211ca2c43d7ca2fa7b7c888a617ddfc (tree)
Time2020-01-15 03:15:04
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

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)

Change Summary

Incremental Difference

diff -r 4858db718203 -r 3856047f2211 src/evalwindow.c
--- a/src/evalwindow.c Mon Jan 13 21:00:04 2020 +0100
+++ b/src/evalwindow.c Tue Jan 14 19:15:04 2020 +0100
@@ -183,7 +183,8 @@
183183 {
184184 #ifdef FEAT_PROP_POPUP
185185 // 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)
187188 if (wp->w_id == nr)
188189 return wp;
189190 // check global popup windows
diff -r 4858db718203 -r 3856047f2211 src/testdir/test_getvar.vim
--- a/src/testdir/test_getvar.vim Mon Jan 13 21:00:04 2020 +0100
+++ b/src/testdir/test_getvar.vim Tue Jan 14 19:15:04 2020 +0100
@@ -83,6 +83,7 @@
8383
8484 unlet def_dict
8585
86+ call assert_equal("", gettabwinvar(9, 2020, ''))
8687 call assert_equal('', gettabwinvar(2, 3, '&nux'))
8788 call assert_equal(1, gettabwinvar(2, 3, '&nux', 1))
8889 tabonly
diff -r 4858db718203 -r 3856047f2211 src/version.c
--- a/src/version.c Mon Jan 13 21:00:04 2020 +0100
+++ b/src/version.c Tue Jan 14 19:15:04 2020 +0100
@@ -743,6 +743,8 @@
743743 static int included_patches[] =
744744 { /* Add new patch number below this line */
745745 /**/
746+ 117,
747+/**/
746748 116,
747749 /**/
748750 115,
Show on old repository browser