projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
509bf8e
)
Check for FD_SETSIZE in silc_select to not go over.
author
Pekka Riikonen
<priikone@silcnet.org>
Wed, 11 May 2005 16:54:14 +0000
(16:54 +0000)
committer
Pekka Riikonen
<priikone@silcnet.org>
Wed, 11 May 2005 16:54:14 +0000
(16:54 +0000)
lib/silcutil/unix/silcunixschedule.c
patch
|
blob
|
history
diff --git
a/lib/silcutil/unix/silcunixschedule.c
b/lib/silcutil/unix/silcunixschedule.c
index d27ceacdb527beb3de1eef7ac02dc6305d02e7e7..7143e7afbd23a9fe0bc08756108abef7e33ced8b 100644
(file)
--- a/
lib/silcutil/unix/silcunixschedule.c
+++ b/
lib/silcutil/unix/silcunixschedule.c
@@
-36,6
+36,11
@@
int silc_select(SilcScheduleFd fds, SilcUInt32 fds_count,
if (!fds[i].events)
continue;
+#ifdef FD_SETSIZE
+ if (fds[i].fd >= FD_SETSIZE)
+ break;
+#endif /* FD_SETSIZE */
+
if (fds[i].fd > max_fd)
max_fd = fds[i].fd;
@@
-55,6
+60,11
@@
int silc_select(SilcScheduleFd fds, SilcUInt32 fds_count,
if (!fds[i].events)
continue;
+#ifdef FD_SETSIZE
+ if (fds[i].fd >= FD_SETSIZE)
+ break;
+#endif /* FD_SETSIZE */
+
if (FD_ISSET(fds[i].fd, &in))
fds[i].revents |= SILC_TASK_READ;
if (FD_ISSET(fds[i].fd, &out))