diff --git a/client.h b/client.h index 93105d0c0..6556f0912 100644 --- a/client.h +++ b/client.h @@ -223,8 +223,10 @@ client_raise(client_t *c) client_t *tc = c; int counter = 0; - /* Find number of transient layers. */ - for(counter = 0; tc->transient_for; counter++) + /* Find number of transient layers. + * We limit the counter to the stack length: if some case, a buggy + * application might set transient_for as a loop… */ + for(counter = 0; tc->transient_for && counter <= globalconf.stack.len; counter++) tc = tc->transient_for; /* Push them in reverse order. */