1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Guard against potential problems

This commit is contained in:
Nicolas Viennot 2016-01-05 18:18:38 -05:00
parent 3ad79d43f9
commit 3c106c8e9c

View File

@ -67,6 +67,11 @@ static void tmate_sync_window_panes(struct window *w,
u_int yoff = unpack_int(&uk);
wp = window_pane_find_by_id(id);
if (wp && wp->window != w) {
/* Pane in the wrong window */
tmate_fatal("Pane id=%u in the wrong window", id);
}
if (!wp) {
next_window_pane_id = id;
wp = window_add_pane(w, TMATE_HLIMIT);