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_2_2_1~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80148701a784b0fd8385bc5581d9ed12d8848ba7;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 fa8771dae15..99ac6ea87ec 100644 --- a/src/main/threads.c +++ b/src/main/threads.c @@ -803,6 +803,10 @@ int thread_pool_init(CONF_SECTION *cs, int *spawn_flag) thread_pool.max_spare_threads = 1; if (thread_pool.max_spare_threads < thread_pool.min_spare_threads) thread_pool.max_spare_threads = thread_pool.min_spare_threads; + 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; + } /* * The pool has already been initialized. Don't spawn