From b743a6e58d71e5ba84704c047b5fd695390cdde6 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 14 Aug 2010 21:33:18 +0000 Subject: [PATCH] check --- src/util/service.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/service.c b/src/util/service.c index 99a364f15..21841dd49 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -1143,7 +1143,9 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) (getpid () == (pid_t) pid) && (NULL != (nfds = getenv ("LISTEN_FDS"))) && (1 == sscanf (nfds, "%u", &cnt)) && - (cnt > 0) ) + (cnt > 0) && + (cnt < FD_SETSIZE) && + (cnt + 4 < FD_SETSIZE) ) { sctx->lsocks = GNUNET_malloc (sizeof(struct GNUNET_NETWORK_Handle*) * (cnt+1)); while (0 < cnt--) -- 2.25.1