summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2021-10-13 21:06:33 +0000
committerMike Perry <mikeperry-git@torproject.org>2022-02-22 19:28:35 +0000
commit338d00ba924a3884900bac425b35b6a2320da306 (patch)
treeb4eff41f47198186fe3066d837e86d644e6deb9e
parent86f81abe3043f273d3aa7166c72d100484af9d73 (diff)
downloadtor-338d00ba924a3884900bac425b35b6a2320da306.tar.gz
tor-338d00ba924a3884900bac425b35b6a2320da306.zip
Fix NULL pointer deref in logs
-rw-r--r--src/core/or/congestion_control_common.c5
-rw-r--r--src/core/or/congestion_control_nola.c3
-rw-r--r--src/core/or/congestion_control_vegas.c3
-rw-r--r--src/core/or/congestion_control_westwood.c3
4 files changed, 8 insertions, 6 deletions
diff --git a/src/core/or/congestion_control_common.c b/src/core/or/congestion_control_common.c
index e316b631d1..6fa3bb9a11 100644
--- a/src/core/or/congestion_control_common.c
+++ b/src/core/or/congestion_control_common.c
@@ -1040,9 +1040,8 @@ congestion_control_update_circuit_bdp(congestion_control_t *cc,
"%"PRIu64", "
"%"PRIu64", "
"%"PRIu64". ",
- // XXX: actually, is this p_chan here? This is
- // an or_circuit (exit or onion)
- circ->n_chan->global_identifier, circ->n_circ_id,
+ CONST_TO_OR_CIRCUIT(circ)->p_chan->global_identifier,
+ CONST_TO_OR_CIRCUIT(circ)->p_circ_id,
cc->min_rtt_usec/1000,
curr_rtt_usec/1000,
cc->ewma_rtt_usec/1000,
diff --git a/src/core/or/congestion_control_nola.c b/src/core/or/congestion_control_nola.c
index 09f88d4699..52d41157a2 100644
--- a/src/core/or/congestion_control_nola.c
+++ b/src/core/or/congestion_control_nola.c
@@ -111,7 +111,8 @@ congestion_control_nola_process_sendme(congestion_control_t *cc,
"INFL: %"PRIu64", "
"NCCE: %"PRIu64", "
"SS: %d",
- circ->n_chan->global_identifier, circ->n_circ_id,
+ CONST_TO_OR_CIRCUIT(circ)->p_chan->global_identifier,
+ CONST_TO_OR_CIRCUIT(circ)->p_circ_id,
cc->cwnd,
cc->inflight,
cc->next_cc_event,
diff --git a/src/core/or/congestion_control_vegas.c b/src/core/or/congestion_control_vegas.c
index e7ed838478..d823a5068e 100644
--- a/src/core/or/congestion_control_vegas.c
+++ b/src/core/or/congestion_control_vegas.c
@@ -255,7 +255,8 @@ congestion_control_vegas_process_sendme(congestion_control_t *cc,
"QUSE: %"PRIu64", "
"NCCE: %"PRIu64", "
"SS: %d",
- circ->n_chan->global_identifier, circ->n_circ_id,
+ CONST_TO_OR_CIRCUIT(circ)->p_chan->global_identifier,
+ CONST_TO_OR_CIRCUIT(circ)->p_circ_id,
cc->cwnd,
cc->inflight,
vegas_bdp_mix(cc),
diff --git a/src/core/or/congestion_control_westwood.c b/src/core/or/congestion_control_westwood.c
index 4b24234212..357cdeb3b9 100644
--- a/src/core/or/congestion_control_westwood.c
+++ b/src/core/or/congestion_control_westwood.c
@@ -213,7 +213,8 @@ congestion_control_westwood_process_sendme(congestion_control_t *cc,
"WRTT: %"PRIu64", "
"WSIG: %"PRIu64", "
"SS: %d",
- circ->n_chan->global_identifier, circ->n_circ_id,
+ CONST_TO_OR_CIRCUIT(circ)->p_chan->global_identifier,
+ CONST_TO_OR_CIRCUIT(circ)->p_circ_id,
cc->cwnd,
cc->inflight,
cc->next_cc_event,