From: Arran Cudbard-Bell Date: Mon, 17 Sep 2012 12:42:51 +0000 (+0100) Subject: Add bounds check for max_queue_size X-Git-Tag: release_3_0_0_beta1~1704 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc95384e2752b1f1d5301acb5717d6ea5b7f8bde;p=thirdparty%2Ffreeradius-server.git Add bounds check for max_queue_size --- diff --git a/src/main/threads.c b/src/main/threads.c index 20ba6b64b21..6b892b10e1b 100644 --- a/src/main/threads.c +++ b/src/main/threads.c @@ -894,6 +894,10 @@ int thread_pool_init(CONF_SECTION *cs, int *spawn_flag) thread_pool.max_spare_threads = thread_pool.min_spare_threads; if (thread_pool.max_threads == 0) thread_pool.max_threads = 256; + if ((thread_pool.max_queue_size < 2) || (thread_pool.max_queue_size > 1048576)) { + radlog(L_ERR, "FATAL: max_queue_size value must be in range 2-1048576"); + return -1; + } #endif /* WITH_GCD */ /*