From: Nick Mathewson Date: Sun, 22 Dec 2013 04:21:33 +0000 (-0500) Subject: Sanity-check arguments to event_base_active_by_fd() X-Git-Tag: release-2.1.4-alpha~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c9da9a8a86a84edd06761d8049d90ef130f4f01;p=libevent Sanity-check arguments to event_base_active_by_fd() --- diff --git a/event.c b/event.c index ed9a8981..7a2cb20d 100644 --- a/event.c +++ b/event.c @@ -3636,7 +3636,7 @@ void event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events) { EVBASE_ACQUIRE_LOCK(base, th_base_lock); - evmap_io_active_(base, fd, events); + evmap_io_active_(base, fd, events & (EV_READ|EV_WRITE|EV_TIMEOUT)); EVBASE_RELEASE_LOCK(base, th_base_lock); } diff --git a/include/event2/event.h b/include/event2/event.h index 2c93e9ab..b081429c 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -1465,10 +1465,11 @@ void event_base_dump_events(struct event_base *, FILE *); /** - Activates all events for the given fd and event mask. + Activates all pending events for the given fd and event mask. - @param fd An fd or signal - @param events One or more EV_* flags + @param base the event_base on which to activate the events. + @param fd An fd to active events on. + @param events One or more of EV_{READ,WRITE,TIMEOUT}. */ void event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events);