diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-12-30 19:54:13 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2011-01-15 19:42:17 +0100 |
commit | 026e7987ad312a26efb926ae44adc158770de7cd (patch) | |
tree | 73a8e03bc137be9aa3aaa644ea5bc2e1a1586987 /src/or/networkstatus.h | |
parent | ca6c8136128eed09a33aeeddc6d11b58b4eb361b (diff) | |
download | tor-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/networkstatus.h')
-rw-r--r-- | src/or/networkstatus.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/networkstatus.h b/src/or/networkstatus.h index f95c1563b4..ec2e8f884d 100644 --- a/src/or/networkstatus.h +++ b/src/or/networkstatus.h @@ -82,7 +82,8 @@ char *networkstatus_getinfo_helper_single(routerstatus_t *rs); char *networkstatus_getinfo_by_purpose(const char *purpose_string, time_t now); void networkstatus_dump_bridge_status_to_file(time_t now); int32_t networkstatus_get_param(networkstatus_t *ns, const char *param_name, - int32_t default_val); + int32_t default_val, int32_t min_val, + int32_t max_val); int getinfo_helper_networkstatus(control_connection_t *conn, const char *question, char **answer, const char **errmsg); |