mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Behave correctly when state->max_length is zero.
This commit is contained in:
@@ -525,7 +525,10 @@ circpad_choose_state_length(circpad_machine_runtime_t *mi)
|
||||
length = circpad_distribution_sample(state->length_dist);
|
||||
length = MAX(0, length);
|
||||
length += state->start_length;
|
||||
length = MIN(length, state->max_length);
|
||||
|
||||
if (state->max_length) {
|
||||
length = MIN(length, state->max_length);
|
||||
}
|
||||
|
||||
mi->state_length = clamp_double_to_int64(length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user