diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-06-29 19:46:43 +0300 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-07-25 10:24:23 -0400 |
commit | af26cd61015a2c127dbcf7e3db91da91adb415f9 (patch) | |
tree | c28d06bbc4cb2868fd4e38fa0baa5ee6ff35a0cf /src/core | |
parent | bd1ac408d854758cc40bde88cc5f71b46661b51c (diff) | |
download | tor-af26cd61015a2c127dbcf7e3db91da91adb415f9.tar.gz tor-af26cd61015a2c127dbcf7e3db91da91adb415f9.zip |
Always check the retval of circpad_machine_current_state().
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/or/circuitpadding.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/or/circuitpadding.c b/src/core/or/circuitpadding.c index 626787da7b..c4670bbc2f 100644 --- a/src/core/or/circuitpadding.c +++ b/src/core/or/circuitpadding.c @@ -450,6 +450,9 @@ circpad_is_token_removal_supported(circpad_machine_runtime_t *mi) /* Machines that do want token removal are less sensitive to performance. * Let's spend some time to check that our state is consistent and sane */ const circpad_state_t *state = circpad_machine_current_state(mi); + if (BUG(!state)) { + return 1; + } tor_assert_nonfatal(state->token_removal != CIRCPAD_TOKEN_REMOVAL_NONE); tor_assert_nonfatal(state->histogram_len == mi->histogram_len); tor_assert_nonfatal(mi->histogram_len != 0); @@ -1667,6 +1670,9 @@ circpad_estimate_circ_rtt_on_received(circuit_t *circ, } } else { const circpad_state_t *state = circpad_machine_current_state(mi); + if (BUG(!state)) { + return; + } /* Since monotime is unpredictably expensive, only update this field * if rtt estimates are needed. Otherwise, stop the rtt update. */ |