From 03886eeeaa4fd394d446d6594be2c92b98e8de57 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 8 Oct 2000 13:21:17 +0000 Subject: [PATCH] (doit_active): check that fds are not too large to select on git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9100 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/kx/kx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/appl/kx/kx.c b/appl/kx/kx.c index fa047ca09..81e80e2d9 100644 --- a/appl/kx/kx.c +++ b/appl/kx/kx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -448,8 +448,11 @@ doit_active (kx_context *kc) socklen_t zero = 0; FD_ZERO(&fdset); - for (i = 0; i < nsockets; ++i) + for (i = 0; i < nsockets; ++i) { + if (sockets[i].fd >= FD_SETSIZE) + errx (1, "fd too large"); FD_SET(sockets[i].fd, &fdset); + } if (select(FD_SETSIZE, &fdset, NULL, NULL, NULL) <= 0) continue; for (i = 0; i < nsockets; ++i)