mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
mp_rpc_server.C: limit iteration of svc_fdset to FD_SETSIZE, as per spec.
In init() there was code iterating over all of the possible file descriptors in a svc_fdset. fdsets are limited to FD_SETSIZE. This caused coredumps on FreeBSD 10, and possibly other hidden issues. Moving to poll(), rather than select() would be better, but is a bigger job. For now, just limit to the FD_SETSIZE that select() requires.
This commit is contained in:
parent
9b9b3430ec
commit
9f0fbc3015
1 changed files with 1 additions and 2 deletions
|
@ -244,8 +244,7 @@ init(void (*service_fn)(struct svc_req *, SVCXPRT *))
|
|||
(void)endnetconfig(handlep);
|
||||
#endif /* OPT_TLI */
|
||||
// now figure out what fd the rpc package is using
|
||||
int maxfds = _tt_global->maxfds();
|
||||
for (int i=0; i < maxfds; i++) {
|
||||
for (int i=0; i < FD_SETSIZE; i++) {
|
||||
if (FD_ISSET(i, &svc_fdset)) {
|
||||
_rpc_fd = i;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue