]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Tweak an assert that shouldn't fire either way.
authorMike Perry <mikeperry-git@fscked.org>
Wed, 7 Oct 2009 20:05:28 +0000 (13:05 -0700)
committerMike Perry <mikeperry-git@fscked.org>
Wed, 7 Oct 2009 20:05:28 +0000 (13:05 -0700)
There were however other places where we used to call this
function that might have caused this to fire. Better
safe than sorry now.

src/or/circuitbuild.c

index 0ff7f272f47cf0b879f20f74072a46567fe7b81a..54edccc9a7e39e8f62700e326da919ecc58ffd45 100644 (file)
@@ -650,7 +650,7 @@ circuit_build_times_initial_alpha(circuit_build_times_t *cbt,
   // CircBuildTimeout = Xm*((1-0.8))^(-1/a))
   // ln(CircBuildTimeout) = ln(Xm)+ln(((1-0.8)))*(-1/a)
   // -ln(1-0.8)/(ln(CircBuildTimeout)-ln(Xm))=a
-  tor_assert(quantile > 0);
+  tor_assert(quantile >= 0);
   tor_assert(cbt->Xm > 0);
   cbt->alpha = ln(1.0-quantile)/(ln(cbt->Xm)-ln(timeout_ms));
   tor_assert(cbt->alpha > 0);