client: add a limit to the loop (FS#573)

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-24 15:23:22 +02:00
parent 316bca21be
commit b8de5f2d43
1 changed files with 4 additions and 2 deletions

View File

@ -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. */