mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
server_kill_window can modify the RB tree so don't use RB_FOREACH, fixes
crash seen by Dan Harnett.
This commit is contained in:
@ -239,10 +239,14 @@ server_lock_client(struct client *c)
|
|||||||
void
|
void
|
||||||
server_kill_window(struct window *w)
|
server_kill_window(struct window *w)
|
||||||
{
|
{
|
||||||
struct session *s;
|
struct session *s, *next_s;
|
||||||
struct winlink *wl;
|
struct winlink *wl;
|
||||||
|
|
||||||
RB_FOREACH(s, sessions, &sessions) {
|
next_s = RB_MIN(sessions, &sessions);
|
||||||
|
while (next_s != NULL) {
|
||||||
|
s = next_s;
|
||||||
|
next_s = RB_NEXT(sessions, &sessions, s);
|
||||||
|
|
||||||
if (session_has(s, w) == NULL)
|
if (session_has(s, w) == NULL)
|
||||||
continue;
|
continue;
|
||||||
while ((wl = winlink_find_by_window(&s->windows, w)) != NULL) {
|
while ((wl = winlink_find_by_window(&s->windows, w)) != NULL) {
|
||||||
|
Reference in New Issue
Block a user