summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-12-11 22:03:09 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-12-11 22:03:09 +0000
commitba6dba6ff85ffacc7500ea3e48a2096d58715bed (patch)
tree1a83313095a37709cc7b6a0c014ba81b38dd1d19 /lib
parent5bef1b391187e480bed62714696082a09bdefa98 (diff)
__svc_fdsetsize is counted in bits, not in array elements
When exceeding fd 1024, this bug cleared flag bits for all file descriptors except those <= 64. Found while auditing a (false positive) complaint by parfait. This bugfix does not shut parfait up, though. OK millert@ deraadt@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/svc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c
index 99fb4799d77..3796aecfeb3 100644
--- a/lib/libc/rpc/svc.c
+++ b/lib/libc/rpc/svc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svc.c,v 1.22 2009/06/05 20:23:38 deraadt Exp $ */
+/* $OpenBSD: svc.c,v 1.23 2009/12/11 22:03:08 schwarze Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -179,7 +179,7 @@ svc_fd_insert(int sock)
if (__svc_fdset != &svc_fdset)
free(__svc_fdset);
__svc_fdset = fds;
- __svc_fdsetsize = bytes / sizeof(fd_mask);
+ __svc_fdsetsize = bytes / sizeof(fd_mask) * NFDBITS;
}
}