]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix two typo bugs found by new state length test.
authorMike Perry <mikeperry-git@torproject.org>
Wed, 15 May 2019 03:33:53 +0000 (03:33 +0000)
committerGeorge Kadianakis <desnacked@riseup.net>
Wed, 15 May 2019 12:10:48 +0000 (15:10 +0300)
src/core/or/circuitpadding.c

index 7674f3510cd502e7afdcd6c78d07a8421a873316..3124e740332340006d26a14a171db0bff2575ea5 100644 (file)
@@ -253,7 +253,7 @@ circpad_histogram_bin_to_usec(const circpad_machine_runtime_t *mi,
 
   /* The infinity bin has an upper bound of infinity, so make sure we return
    * that if they ask for it. */
-  if (bin > CIRCPAD_INFINITY_BIN(mi)) {
+  if (bin > CIRCPAD_INFINITY_BIN(state)) {
     return CIRCPAD_DELAY_INFINITE;
   }
 
@@ -936,7 +936,7 @@ circpad_machine_update_state_length_for_nonpadding(
 {
   const circpad_state_t *state = NULL;
 
-  if (mi->state_length != CIRCPAD_STATE_LENGTH_INFINITE)
+  if (mi->state_length == CIRCPAD_STATE_LENGTH_INFINITE)
     return;
 
   state = circpad_machine_current_state(mi);