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 :-/...
This commit is contained in:
Nicholas Marriott 2009-10-11 10:39:27 +00:00
parent 64b5f39656
commit fbb030d7f7

View File

@ -284,8 +284,10 @@ server_link_window(struct session *src, struct winlink *srcwl,
winlink_remove(&dst->windows, dstwl); winlink_remove(&dst->windows, dstwl);
/* Force select/redraw if current. */ /* Force select/redraw if current. */
if (dstwl == dst->curw) if (dstwl == dst->curw) {
selectflag = 1; selectflag = 1;
dst->curw = NULL;
}
} }
} }