summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-08-29 07:46:40 +0000
committerUlrich Drepper <drepper@redhat.com>2003-08-29 07:46:40 +0000
commit0994e2b880ea1b598c01a0c14b83f7ae0fe33580 (patch)
treef986095b2245b5fc9daa417ef79e8b2094ac3bcc
parent3c945c44e79706acd40d279e0468c4035ed5b0ba (diff)
downloadglibc-0994e2b880ea1b598c01a0c14b83f7ae0fe33580.tar.gz
Update.
2003-08-27 Phil Knirsch <pknirsch@redhat.com> Jakub Jelinek <jakub@redhat.com> * sunrpc/svc.c (svc_getreqset): Fix fds_bits reading on 64-bit big endian arches. Don't read beyond end of fds_bits array.
-rw-r--r--ChangeLog6
-rw-r--r--sunrpc/svc.c10
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8eda2c2f5c..ede07c1af8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-08-27 Phil Knirsch <pknirsch@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * sunrpc/svc.c (svc_getreqset): Fix fds_bits reading on 64-bit
+ big endian arches. Don't read beyond end of fds_bits array.
+
2003-04-27 Bruno Haible <bruno@clisp.org>
* manual/message.texi (Advanced gettext functions): Add information
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index b7c4f096dd..fe27c3c861 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -361,15 +361,17 @@ INTDEF (svc_getreq)
void
svc_getreqset (fd_set *readfds)
{
- register u_int32_t mask;
- register u_int32_t *maskp;
+ register fd_mask mask;
+ register fd_mask *maskp;
register int setsize;
register int sock;
register int bit;
setsize = _rpc_dtablesize ();
- maskp = (u_int32_t *) readfds->fds_bits;
- for (sock = 0; sock < setsize; sock += 32)
+ if (setsize > FD_SETSIZE)
+ setsize = FD_SETSIZE;
+ maskp = readfds->fds_bits;
+ for (sock = 0; sock < setsize; sock += NFDBITS)
for (mask = *maskp++; (bit = ffs (mask)); mask ^= (1 << (bit - 1)))
INTUSE(svc_getreq_common) (sock + bit - 1);
}