diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-02-13 09:11:35 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-02-13 09:11:35 -0500 |
commit | fff1054d17c8e869c38d4ca1c68ed74a7e82e393 (patch) | |
tree | 5968025102bf9049bad77facc6b52f9899a66d1f | |
parent | 80e3dc47272c9ba423d40ce367fb99d39c3150ec (diff) | |
download | tor-fff1054d17c8e869c38d4ca1c68ed74a7e82e393.tar.gz tor-fff1054d17c8e869c38d4ca1c68ed74a7e82e393.zip |
Before freeing ewma objects, use memwipe instead of resetting magic.
-rw-r--r-- | src/core/or/circuitmux_ewma.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/or/circuitmux_ewma.c b/src/core/or/circuitmux_ewma.c index 606b755e28..07f83af0f1 100644 --- a/src/core/or/circuitmux_ewma.c +++ b/src/core/or/circuitmux_ewma.c @@ -38,6 +38,7 @@ #include "core/or/circuitmux.h" #include "core/or/circuitmux_ewma.h" #include "lib/crypt_ops/crypto_rand.h" +#include "lib/crypt_ops/crypto_util.h" #include "feature/nodelist/networkstatus.h" #include "app/config/or_options_st.h" @@ -299,7 +300,7 @@ ewma_free_cmux_data(circuitmux_t *cmux, pol = TO_EWMA_POL_DATA(pol_data); smartlist_free(pol->active_circuit_pqueue); - pol->base_.magic = 0xDEAD901C; + memwipe(pol, 0xda, sizeof(ewma_policy_data_t)); tor_free(pol); } @@ -366,7 +367,7 @@ ewma_free_circ_data(circuitmux_t *cmux, if (!pol_circ_data) return; cdata = TO_EWMA_POL_CIRC_DATA(pol_circ_data); - cdata->base_.magic = 0xDEADC14C; + memwipe(cdata, 0xdc, sizeof(ewma_policy_circ_data_t)); tor_free(cdata); } |