mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Merge branch 'maint-0.2.9'
This commit is contained in:
commit
2499ea359a
4
changes/bug20875
Normal file
4
changes/bug20875
Normal file
@ -0,0 +1,4 @@
|
||||
o Minor bugfixes (download scheduling)
|
||||
- Resolve a "bug" warning when considering a download schedule whose
|
||||
delay had approached INT_MAX. Fixes 20875; bugfix on 0.2.9.5-alpha.
|
||||
|
@ -3988,10 +3988,12 @@ STATIC int
|
||||
next_random_exponential_delay(int delay, int max_delay)
|
||||
{
|
||||
/* Check preconditions */
|
||||
if (BUG(max_delay < 0))
|
||||
max_delay = 0;
|
||||
if (BUG(delay > max_delay))
|
||||
delay = max_delay;
|
||||
if (BUG(delay == INT_MAX))
|
||||
delay -= 1; /* prevent overflow */
|
||||
if (delay == INT_MAX)
|
||||
return INT_MAX; /* prevent overflow */
|
||||
if (BUG(delay < 0))
|
||||
delay = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user