mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user