aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_workqueue.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-03-24 10:49:29 -0400
committerNick Mathewson <nickm@torproject.org>2015-03-24 10:49:29 -0400
commit8f951d019656ecdc49f2b944781539c40e1a8392 (patch)
treebc0b78802015e425061a0c1fa552a095e08253a0 /src/test/test_workqueue.c
parentfec923d72b2cb40f4d696cc1d2306d4c5779bed0 (diff)
downloadtor-8f951d019656ecdc49f2b944781539c40e1a8392.tar.gz
tor-8f951d019656ecdc49f2b944781539c40e1a8392.zip
Put an upper bound on test_workqueue -I argument
This makes coverity happy, since it doesn't like us looping against a value which might be INT_MAX. This is CID 1268069
Diffstat (limited to 'src/test/test_workqueue.c')
-rw-r--r--src/test/test_workqueue.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/test_workqueue.c b/src/test/test_workqueue.c
index aaff5069be..83f6f3e215 100644
--- a/src/test/test_workqueue.c
+++ b/src/test/test_workqueue.c
@@ -18,6 +18,8 @@
#include <event.h>
#endif
+#define MAX_INFLIGHT (1<<16)
+
static int opt_verbose = 0;
static int opt_n_threads = 8;
static int opt_n_items = 10000;
@@ -348,7 +350,7 @@ main(int argc, char **argv)
}
if (opt_n_threads < 1 ||
opt_n_items < 1 || opt_n_inflight < 1 || opt_n_lowwater < 0 ||
- opt_n_cancel > opt_n_inflight ||
+ opt_n_cancel > opt_n_inflight || opt_n_inflight > MAX_INFLIGHT ||
opt_ratio_rsa < 0) {
help();
return 1;