diff options
author | milo <milo@r0ot.me> | 2011-04-20 04:09:28 +0200 |
---|---|---|
committer | milo <milo@r0ot.me> | 2011-04-20 05:05:07 +0200 |
commit | eace59d3eaad413fd846d1c8b4c926285f6cd5ab (patch) | |
tree | d873e3e1a16e400e4444836390adcc54458d9406 | |
parent | 27313334578f4acb7ccf0687bba7f76b2febd569 (diff) | |
download | libssh-eace59d3eaad413fd846d1c8b4c926285f6cd5ab.tar.gz libssh-eace59d3eaad413fd846d1c8b4c926285f6cd5ab.tar.xz libssh-eace59d3eaad413fd846d1c8b4c926285f6cd5ab.zip |
[poll] avoid infinite loop in ssh_poll_ctx_free()
-rw-r--r-- | src/poll.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -495,7 +495,12 @@ void ssh_poll_ctx_free(ssh_poll_ctx ctx) { /* force poll object removal */ if (p->cb && p->cb(p, fd, POLLERR, p->cb_data) < 0) { - used = ctx->polls_used; + if(ctx->polls_used < used) { + used = ctx->polls_used; + } else { + /* nothing to do */ + i++; + } } else { i++; } |