From 57975d729bd2ed24721a0755056399f8efeafe51 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Wed, 15 Nov 2000 22:59:21 +0000 Subject: [PATCH] (loop): check that the fd's aren't too large to select on git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9186 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/rsh/rshd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appl/rsh/rshd.c b/appl/rsh/rshd.c index d0a79d004..084d3ebdf 100644 --- a/appl/rsh/rshd.c +++ b/appl/rsh/rshd.c @@ -404,6 +404,9 @@ loop (int from0, int to0, int max_fd; int count = 2; + if(from0 >= FD_SETSIZE || from1 >= FD_SETSIZE || from2 >= FD_SETSIZE) + errx (1, "fd too large"); + FD_ZERO(&real_readset); FD_SET(from0, &real_readset); FD_SET(from1, &real_readset);