git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix denial of service - memory corruption.
[samba.git]
/
lib
/
tevent
/
tevent_standard.c
diff --git
a/lib/tevent/tevent_standard.c
b/lib/tevent/tevent_standard.c
index c3f8b36e840faf52773d1e7c6327a23cf909c7c4..d4a00cc062a4e472a309d211f490e979cc36c134 100644
(file)
--- 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);
}