aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-10-12 00:37:41 +0000
committerTiago Cunha <tcunha@gmx.com>2009-10-12 00:37:41 +0000
commit39afe3fc2ac79e8a875296d66ab42328f309e2ab (patch)
tree4216c6ef2a446835df5deb8ebdaf069ac3639dad
parent3584fa15ec1cfc9429e64622ae63a6f2fe04cdd5 (diff)
downloadrtmux-39afe3fc2ac79e8a875296d66ab42328f309e2ab.tar.gz
rtmux-39afe3fc2ac79e8a875296d66ab42328f309e2ab.tar.bz2
rtmux-39afe3fc2ac79e8a875296d66ab42328f309e2ab.zip
Sync OpenBSD patchset 388:
Set the current window pointer to NULL when killing a winlink that is to be replaced with link-window -k. This prevents it being pushed onto the last window stack and causing a use-after-free. Only took me an hour to find this :-/...
-rw-r--r--server-fn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/server-fn.c b/server-fn.c
index f34c8aec..e7077335 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -1,4 +1,4 @@
-/* $Id: server-fn.c,v 1.93 2009-10-11 23:38:16 tcunha Exp $ */
+/* $Id: server-fn.c,v 1.94 2009-10-12 00:37:41 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -284,8 +284,10 @@ server_link_window(struct session *src, struct winlink *srcwl,
winlink_remove(&dst->windows, dstwl);
/* Force select/redraw if current. */
- if (dstwl == dst->curw)
+ if (dstwl == dst->curw) {
selectflag = 1;
+ dst->curw = NULL;
+ }
}
}