aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-20 11:02:05 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-20 11:02:07 -0400
commit9ae35975402a823a420cd5efb81a1c3a76f6c4d6 (patch)
tree04c963ca8662a8c8322ae000aa10998823eaf4c3 /src/feature
parent583df33e2079c6f7b5e0ebe34b5f29d8739a673b (diff)
downloadtor-9ae35975402a823a420cd5efb81a1c3a76f6c4d6.tar.gz
tor-9ae35975402a823a420cd5efb81a1c3a76f6c4d6.zip
Tweak assertion in get_time_period_length() for coverity
This is another attempt to fix 1437668. The assertion here should be safe, since the rules of networkstatus_get_param() keep the value it returns in range.
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/hs/hs_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/feature/hs/hs_common.c b/src/feature/hs/hs_common.c
index 328430be08..1c5dfd5e63 100644
--- a/src/feature/hs/hs_common.c
+++ b/src/feature/hs/hs_common.c
@@ -254,8 +254,8 @@ get_time_period_length(void)
HS_TIME_PERIOD_LENGTH_MIN,
HS_TIME_PERIOD_LENGTH_MAX);
/* Make sure it's a positive value. */
- tor_assert(time_period_length >= 0);
- /* uint64_t will always be able to contain a int32_t */
+ tor_assert(time_period_length > 0);
+ /* uint64_t will always be able to contain a positive int32_t */
return (uint64_t) time_period_length;
}