summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-08-15 15:38:58 +0000
committerNick Mathewson <nickm@torproject.org>2007-08-15 15:38:58 +0000
commitd5bd7d9fa39971d24859493e62e1d3ba3d1dc906 (patch)
tree1acedc967d36204cff40d4ddfee74466db78ca7d /src/or/dirserv.c
parent60c2e9d99e071a08a6e7f6eee82d49477e32aeda (diff)
downloadtor-d5bd7d9fa39971d24859493e62e1d3ba3d1dc906.tar.gz
tor-d5bd7d9fa39971d24859493e62e1d3ba3d1dc906.zip
r14032@Kushana: nickm | 2007-08-15 11:35:16 -0400
Add unit tests for median functions; enforce sensible ranges for intervals and delays. svn:r11121
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 0827406202..ed3a15061c 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1979,6 +1979,9 @@ generate_networkstatus_vote_obj(crypto_pk_env_t *private_key,
(timing.vote_interval * timing.n_intervals_valid);
v3_out->vote_seconds = timing.vote_delay;
v3_out->dist_seconds = timing.dist_delay;
+ tor_assert(v3_out->vote_seconds > 0);
+ tor_assert(v3_out->dist_seconds > 0);
+ tor_assert(timing.n_intervals_valid > 0);
v3_out->client_versions = client_versions;
v3_out->server_versions = server_versions;