summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_standard.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tevent/tevent_standard.c')
-rw-r--r--lib/tevent/tevent_standard.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/tevent/tevent_standard.c b/lib/tevent/tevent_standard.c
index a68a03c2ac..35f7ded9b7 100644
--- a/lib/tevent/tevent_standard.c
+++ b/lib/tevent/tevent_standard.c
@@ -457,6 +457,10 @@ 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);
}