summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-12-21 12:32:20 -0500
committerNick Mathewson <nickm@torproject.org>2015-12-21 12:32:20 -0500
commit8ede8d411a29450a746efdfb950c916b0058b497 (patch)
tree13f7c976dd8ef4c32bc05c844d985041aa306581 /src/or/config.c
parent62f97545e48758c39a5e6e7c4e7cd01073affae0 (diff)
downloadtor-8ede8d411a29450a746efdfb950c916b0058b497.tar.gz
tor-8ede8d411a29450a746efdfb950c916b0058b497.zip
Fix a couple of jenkins issues from 12538.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c
index ce7adbace6..53f2c768d0 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -4097,9 +4097,13 @@ have_enough_mem_for_dircache(const or_options_t *options, size_t total_mem,
char **msg)
{
*msg = NULL;
+ /* XXX We should possibly be looking at MaxMemInQueues here
+ * unconditionally. Or we should believe total_mem unconditionally. */
if (total_mem == 0) {
- if (get_total_system_memory(&total_mem) < 0)
- total_mem = options->MaxMemInQueues;
+ if (get_total_system_memory(&total_mem) < 0) {
+ total_mem = options->MaxMemInQueues >= SIZE_MAX ?
+ SIZE_MAX : options->MaxMemInQueues;
+ }
}
if (options->DirCache) {
if (total_mem < DIRCACHE_MIN_BANDWIDTH) {