aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-12-30 19:54:13 +0100
committerSebastian Hahn <sebastian@torproject.org>2011-01-15 19:42:17 +0100
commit026e7987ad312a26efb926ae44adc158770de7cd (patch)
tree73a8e03bc137be9aa3aaa644ea5bc2e1a1586987 /src/or/circuitlist.c
parentca6c8136128eed09a33aeeddc6d11b58b4eb361b (diff)
downloadtor-026e7987ad312a26efb926ae44adc158770de7cd.tar.gz
tor-026e7987ad312a26efb926ae44adc158770de7cd.zip
Sanity-check consensus param values
We need to make sure that the worst thing that a weird consensus param can do to us is to break our Tor (and only if the other Tors are reliably broken in the same way) so that the majority of directory authorities can't pull any attacks that are worse than the DoS that they can trigger by simply shutting down. One of these worse things was the cbtnummodes parameter, which could lead to heap corruption on some systems if the value was sufficiently large. This commit fixes this particular issue and also introduces sanity checking for all consensus parameters.
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 58ff27e5e1..b4f5f45615 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -384,7 +384,9 @@ circuit_purpose_to_controller_string(uint8_t purpose)
int32_t
circuit_initial_package_window(void)
{
- int32_t num = networkstatus_get_param(NULL, "circwindow", CIRCWINDOW_START);
+ int32_t num = networkstatus_get_param(NULL, "circwindow", CIRCWINDOW_START,
+ CIRCWINDOW_START_MIN,
+ CIRCWINDOW_START_MAX);
/* If the consensus tells us a negative number, we'd assert. */
if (num < 0)
num = CIRCWINDOW_START;