[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Behave correctly when state->max_length is zero.
commit a014e01b686cbe84bcfc9907d0a98ac71be91e3e
Author: George Kadianakis <desnacked@xxxxxxxxxx>
Date: Wed Mar 20 17:42:56 2019 +0200
Behave correctly when state->max_length is zero.
---
src/core/or/circuitpadding.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/core/or/circuitpadding.c b/src/core/or/circuitpadding.c
index ddf28ea62..61e222cbb 100644
--- a/src/core/or/circuitpadding.c
+++ b/src/core/or/circuitpadding.c
@@ -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);
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits