Skip to content

Commit

Permalink
Tweak assertion in get_time_period_length() for coverity
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nmathewson committed Jul 20, 2018
1 parent 583df33 commit 9ae3597
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/feature/hs/hs_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9ae3597

Please sign in to comment.