mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +09:00
[poll] avoid infinite loop in ssh_poll_ctx_free()
(cherry picked from commit 8092541603)
This commit is contained in:
@@ -491,8 +491,13 @@ void ssh_poll_ctx_free(ssh_poll_ctx ctx) {
|
|||||||
socket_t fd = ctx->pollfds[i].fd;
|
socket_t fd = ctx->pollfds[i].fd;
|
||||||
|
|
||||||
/* force poll object removal */
|
/* force poll object removal */
|
||||||
if (p->cb(p, fd, POLLERR, p->cb_data) < 0) {
|
if (p->cb && p->cb(p, fd, POLLERR, p->cb_data) < 0) {
|
||||||
|
if(ctx->polls_used < used) {
|
||||||
used = ctx->polls_used;
|
used = ctx->polls_used;
|
||||||
|
} else {
|
||||||
|
/* nothing to do */
|
||||||
|
i++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user