[vim] 16/139: patch 7.4.1704 Problem: Using freed memory with "wincmd p". (Dominique Pelle) Solution: Also clear "prevwin" in other tab pages.
James McCoy
jamessan at debian.org
Fri May 6 03:59:56 UTC 2016
This is an automated email from the git hooks/post-receive script.
jamessan pushed a commit to branch debian/sid
in repository vim.
commit 3dda7db4e1f7c4a8110a1f83001ec36b46693d27
Author: Bram Moolenaar <Bram at vim.org>
Date: Sun Apr 3 21:22:58 2016 +0200
patch 7.4.1704
Problem: Using freed memory with "wincmd p". (Dominique Pelle)
Solution: Also clear "prevwin" in other tab pages.
---
src/version.c | 2 ++
src/window.c | 13 ++++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/version.c b/src/version.c
index ea6d1c3..58377a4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1704,
+/**/
1703,
/**/
1702,
diff --git a/src/window.c b/src/window.c
index c7905ae..bbd0a52 100644
--- a/src/window.c
+++ b/src/window.c
@@ -340,7 +340,7 @@ newwindow:
/* cursor to last accessed (previous) window */
case 'p':
case Ctrl_P:
- if (prevwin == NULL)
+ if (!win_valid(prevwin))
beep_flush();
else
win_goto(prevwin);
@@ -4577,8 +4577,15 @@ win_free(
unref_var_dict(wp->w_vars);
#endif
- if (prevwin == wp)
- prevwin = NULL;
+ {
+ tabpage_T *ttp;
+
+ if (prevwin == wp)
+ prevwin = NULL;
+ for (ttp = first_tabpage; ttp != NULL; ttp = ttp->tp_next)
+ if (ttp->tp_prevwin == wp)
+ ttp->tp_prevwin = NULL;
+ }
win_free_lsize(wp);
for (i = 0; i < wp->w_tagstacklen; ++i)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/vim.git
More information about the pkg-vim-maintainers
mailing list