]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add bounds check for max_queue_size
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 17 Sep 2012 12:42:51 +0000 (13:42 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 17 Sep 2012 12:45:14 +0000 (13:45 +0100)
src/main/threads.c

index 20ba6b64b216dac10c0544099f4ec4c7544df0d2..6b892b10e1b696b9e2d7b6cf85573248397353eb 100644 (file)
@@ -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 */
 
        /*