diff options
Diffstat (limited to 'lib/tevent/tevent_standard.c')
-rw-r--r-- | lib/tevent/tevent_standard.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tevent/tevent_standard.c b/lib/tevent/tevent_standard.c index c3f8b36e840..d4a00cc062a 100644 --- a/lib/tevent/tevent_standard.c +++ b/lib/tevent/tevent_standard.c @@ -457,6 +457,11 @@ static int std_event_loop_select(struct std_event_context *std_ev, struct timeva /* setup any fd events */ for (fde = std_ev->ev->fd_events; fde; fde = fde->next) { + if (fde->fd < 0 || fde->fd >= FD_SETSIZE) { + std_ev->exit_code = EBADF; + return -1; + } + if (fde->flags & TEVENT_FD_READ) { FD_SET(fde->fd, &r_fds); } |