diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2012-07-09 10:47:30 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2012-07-09 10:47:30 +0000 |
commit | b327c153ce349ba1fa199f65b23d983e376fb657 (patch) | |
tree | efc954ff99f3c9cbad7ed8aaf860e4750108fdb1 /sys | |
parent | 88990884fb6d8058429a8e871679a8ee4aecf422 (diff) |
Compare the size of the static fd_mask against the number of bytes needed
not against the number bit / number of fds in the select set.
ok guenther@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/sys_generic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 60e69e6ba22..c975e9622e1 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.76 2012/04/22 05:43:14 guenther Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.77 2012/07/09 10:47:29 claudio Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -546,7 +546,7 @@ sys_select(struct proc *p, void *v, register_t *retval) nd = p->p_fd->fd_nfiles; } ni = howmany(nd, NFDBITS) * sizeof(fd_mask); - if (nd > sizeof(bits[0])) { + if (ni > sizeof(bits[0])) { caddr_t mbits; mbits = malloc(ni * 6, M_TEMP, M_WAITOK|M_ZERO); |