Skip to content
Snippets Groups Projects
Commit 677f9353 authored by Vort's avatar Vort
Browse files

Prevent monotime overflow

parent 6d6bd21b
No related branches found
No related tags found
No related merge requests found
......@@ -522,6 +522,13 @@ monotime_init_internal(void)
tor_assert(n <= INT64_MAX);
tor_assert(d <= INT64_MAX);
while (d > ONE_MILLION)
{
n /= 10;
d /= 10;
}
simplify_fraction64(&n, &d);
nsec_per_tick_numer = (int64_t) n;
nsec_per_tick_denom = (int64_t) d;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment