diff options
author | Bram Moolenaar <bram@vim.org> | 2013-07-03 14:01:56 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2013-07-03 14:01:56 +0200 |
commit | c3f18f2fe440056453ff1b99a64f7012759c6818 (patch) | |
tree | 733283b71bb48f734fdf0df0653154a65af8a952 | |
parent | e2bac0d9768c660443042ed45a34514778ce079f (diff) | |
download | vim-c3f18f2fe440056453ff1b99a64f7012759c6818.tar.gz |
Problem: Possibly using invalid pointer when searcing for window. (Raichoo)
Solution: Use "firstwin" instead of "tp_firstwin" for current tab.
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/window.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/version.c b/src/version.c index 8c498218..d661c643 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1292, +/**/ 1291, /**/ 1290, diff --git a/src/window.c b/src/window.c index 54ab2008..2435952e 100644 --- a/src/window.c +++ b/src/window.c @@ -4077,7 +4077,8 @@ win_find_tabpage(win) tabpage_T *tp; for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) - for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next) + for (wp = (tp == curtab ? firstwin : tp->tp_firstwin); + wp != NULL; wp = wp->w_next) if (wp == win) return tp; return NULL; |