From: Miroslav Lichvar Date: Fri, 15 Aug 2014 14:36:00 +0000 (+0200) Subject: sched: check that added file descriptor fits in fd_set X-Git-Tag: 1.31-pre1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07f7f28058f61730abe17cb8333c48d2108bc614;p=thirdparty%2Fchrony.git sched: check that added file descriptor fits in fd_set --- diff --git a/sched.c b/sched.c index 80d68fdf..81b58f71 100644 --- a/sched.c +++ b/sched.c @@ -169,6 +169,9 @@ SCH_AddInputFileHandler assert(initialised); + if (fd >= FD_SETSIZE) + LOG_FATAL(LOGF_Scheduler, "Too many file descriptors"); + /* Don't want to allow the same fd to register a handler more than once without deleting a previous association - this suggests a bug somewhere else in the program. */