diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-03-26 11:16:06 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-03-26 11:16:06 +0000 |
commit | 1f28fd97cb1f090464e23addd0e8e415d67cf92f (patch) | |
tree | 228508eac46927a9128eac73334b29762a82dd7a /pjlib/src/pj/ioqueue_select.c | |
parent | ef4ea1ede696da8b06aaf93b8a5f14d28295ffe7 (diff) |
Ticket #769: Bug in select ioqueue: event counter may exceed maximum value, causing stack corruption (thanks Joel Dodson for the report)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2554 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/ioqueue_select.c')
-rw-r--r-- | pjlib/src/pj/ioqueue_select.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pjlib/src/pj/ioqueue_select.c b/pjlib/src/pj/ioqueue_select.c index 51d0eb5d..d4f93728 100644 --- a/pjlib/src/pj/ioqueue_select.c +++ b/pjlib/src/pj/ioqueue_select.c @@ -727,7 +727,8 @@ PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioqueue, const pj_time_val *timeout) /* Scan for readable socket. */ if ((key_has_pending_read(h) || key_has_pending_accept(h)) - && PJ_FD_ISSET(h->fd, &rfdset) && !IS_CLOSING(h)) + && PJ_FD_ISSET(h->fd, &rfdset) && !IS_CLOSING(h) && + counter<count) { #if PJ_IOQUEUE_HAS_SAFE_UNREG increment_counter(h); @@ -739,7 +740,7 @@ PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioqueue, const pj_time_val *timeout) #if PJ_HAS_TCP if (key_has_pending_connect(h) && PJ_FD_ISSET(h->fd, &xfdset) && - !IS_CLOSING(h)) + !IS_CLOSING(h) && counter<count) { #if PJ_IOQUEUE_HAS_SAFE_UNREG increment_counter(h); |